@@ -701,6 +701,35 @@ void configt::ansi_ct::set_arch_spec_loongarch64()
701701 }
702702}
703703
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+
704733configt::ansi_ct::c_standardt configt::ansi_ct::default_c_standard ()
705734{
706735#if defined(__APPLE__)
@@ -787,6 +816,8 @@ void configt::set_arch(const irep_idt &arch)
787816 ansi_c.set_arch_spec_i386 ();
788817 else if (arch == " loongarch64" )
789818 ansi_c.set_arch_spec_loongarch64 ();
819+ else if (arch == " emscripten" )
820+ ansi_c.set_arch_spec_emscripten ();
790821 else
791822 {
792823 // We run on something new and unknown.
@@ -1482,6 +1513,8 @@ irep_idt configt::this_architecture()
14821513 this_arch = " sh4" ;
14831514 #elif defined(__loongarch__)
14841515 this_arch = " loongarch64" ;
1516+ #elif defined(__EMSCRIPTEN__)
1517+ this_arch = " emscripten" ;
14851518 #else
14861519 // something new and unknown!
14871520 this_arch = " unknown" ;
@@ -1527,6 +1560,8 @@ irep_idt configt::this_operating_system()
15271560 this_os=" solaris" ;
15281561#elif __gnu_hurd__
15291562 this_os = " hurd" ;
1563+ #elif __EMSCRIPTEN__
1564+ this_os = " emscripten" ;
15301565#else
15311566 this_os=" unknown" ;
15321567#endif
0 commit comments