@@ -701,6 +701,35 @@ void configt::ansi_ct::set_arch_spec_loongarch64()
701
701
}
702
702
}
703
703
704
+ void configt::ansi_ct::set_arch_spec_emscripten ()
705
+ {
706
+ set_ILP32 ();
707
+ endianness = endiannesst::IS_LITTLE_ENDIAN;
708
+ long_double_width = 16 * 8 ;
709
+ char_is_unsigned = false ;
710
+ NULL_is_zero = true ;
711
+
712
+ switch (mode)
713
+ {
714
+ case flavourt::CLANG:
715
+ defines.push_back (" __EMSCRIPTEN__" );
716
+ break ;
717
+
718
+ case flavourt::VISUAL_STUDIO:
719
+ UNREACHABLE; // not supported by Visual Studio
720
+ break ;
721
+
722
+ case flavourt::GCC:
723
+ case flavourt::CODEWARRIOR:
724
+ case flavourt::ARM:
725
+ case flavourt::ANSI:
726
+ break ;
727
+
728
+ case flavourt::NONE:
729
+ UNREACHABLE;
730
+ }
731
+ }
732
+
704
733
configt::ansi_ct::c_standardt configt::ansi_ct::default_c_standard ()
705
734
{
706
735
#if defined(__APPLE__)
@@ -787,6 +816,8 @@ void configt::set_arch(const irep_idt &arch)
787
816
ansi_c.set_arch_spec_i386 ();
788
817
else if (arch == " loongarch64" )
789
818
ansi_c.set_arch_spec_loongarch64 ();
819
+ else if (arch == " emscripten" )
820
+ ansi_c.set_arch_spec_emscripten ();
790
821
else
791
822
{
792
823
// We run on something new and unknown.
@@ -1482,6 +1513,8 @@ irep_idt configt::this_architecture()
1482
1513
this_arch = " sh4" ;
1483
1514
#elif defined(__loongarch__)
1484
1515
this_arch = " loongarch64" ;
1516
+ #elif defined(__EMSCRIPTEN__)
1517
+ this_arch = " emscripten" ;
1485
1518
#else
1486
1519
// something new and unknown!
1487
1520
this_arch = " unknown" ;
@@ -1527,6 +1560,8 @@ irep_idt configt::this_operating_system()
1527
1560
this_os=" solaris" ;
1528
1561
#elif __gnu_hurd__
1529
1562
this_os = " hurd" ;
1563
+ #elif __EMSCRIPTEN__
1564
+ this_os = " emscripten" ;
1530
1565
#else
1531
1566
this_os=" unknown" ;
1532
1567
#endif
0 commit comments