cprover
Loading...
Searching...
No Matches
config.cpp
Go to the documentation of this file.
1/*******************************************************************\
2
3Module:
4
5Author: Daniel Kroening, kroening@kroening.com
6
7\*******************************************************************/
8
9#include "config.h"
10
11#include "arith_tools.h"
12#include "cmdline.h"
13#include "cprover_prefix.h"
14#include "exception_utils.h"
15#include "namespace.h"
16#include "pointer_expr.h"
17#include "simplify_expr.h"
18#include "string2int.h"
19#include "string_utils.h"
20#include "symbol_table_base.h"
21
22#include <climits>
23#include <cstdlib>
24
26
31
36
38{
39 #ifdef _WIN32
40 set_LLP64();
41 #else
42 set_LP64();
43 #endif
44}
45
65
67// TODO: find the alignment restrictions (per type) of the different
68// architectures (currently: sizeof=alignedof)
69// TODO: implement the __attribute__((__aligned__(val)))
70
89
109
112{
113 bool_width=1*8;
114 int_width=4*8;
115 long_int_width=4*8;
116 char_width=1*8;
117 short_int_width=2*8;
119 pointer_width=4*8;
120 single_width=4*8;
121 double_width=8*8;
122 long_double_width=12*8; // really 96 bits on GCC
123 char_is_unsigned=false;
125 wchar_t_width=4*8;
126 alignment=1;
128}
129
132{
133 bool_width=1*8;
134 int_width=2*8;
135 long_int_width=4*8;
136 char_width=1*8;
137 short_int_width=2*8;
139 pointer_width=4*8;
140 single_width=4*8;
141 double_width=8*8;
143 char_is_unsigned=false;
145 wchar_t_width=4*8;
146 alignment=1;
148}
149
168
170{
171 arch_is_x86_family = true;
173 set_ILP32();
175 char_is_unsigned=false;
176 NULL_is_zero=true;
177
178 switch(mode)
179 {
180 case flavourt::GCC:
181 case flavourt::CLANG:
182 defines.push_back("i386");
183 defines.push_back("__i386");
184 defines.push_back("__i386__");
185 if(mode == flavourt::CLANG)
186 defines.push_back("__LITTLE_ENDIAN__");
187 break;
188
190 defines.push_back("_M_IX86");
191 break;
192
194 case flavourt::ARM:
195 case flavourt::ANSI:
196 break;
197
198 case flavourt::NONE:
200 }
201}
202
204{
205 arch_is_x86_family = true;
207 set_LP64();
210 char_is_unsigned=false;
211 NULL_is_zero=true;
212
213 switch(mode)
214 {
215 case flavourt::GCC:
216 case flavourt::CLANG:
217 defines.push_back("__LP64__");
218 defines.push_back("__x86_64");
219 defines.push_back("__x86_64__");
220 defines.push_back("_LP64");
221 defines.push_back("__amd64__");
222 defines.push_back("__amd64");
223
224 if(os == ost::OS_MACOS)
225 defines.push_back("__LITTLE_ENDIAN__");
226 break;
227
229 defines.push_back("_M_X64");
230 defines.push_back("_M_AMD64");
231 break;
232
234 case flavourt::ARM:
235 case flavourt::ANSI:
236 break;
237
238 case flavourt::NONE:
240 }
241}
242
244{
245 arch_is_x86_family = false;
247 if(subarch=="powerpc")
248 set_ILP32();
249 else // ppc64 or ppc64le
250 set_LP64();
251
252 if(subarch=="ppc64le")
254 else
256
258 char_is_unsigned=true;
259 NULL_is_zero=true;
260
261 switch(mode)
262 {
263 case flavourt::GCC:
264 case flavourt::CLANG:
265 defines.push_back("__powerpc");
266 defines.push_back("__powerpc__");
267 defines.push_back("__POWERPC__");
268 defines.push_back("__ppc__");
269
270 if(os == ost::OS_MACOS)
271 defines.push_back("__BIG_ENDIAN__");
272
273 if(subarch!="powerpc")
274 {
275 defines.push_back("__powerpc64");
276 defines.push_back("__powerpc64__");
277 defines.push_back("__PPC64__");
278 defines.push_back("__ppc64__");
279 if(subarch=="ppc64le")
280 {
281 defines.push_back("_CALL_ELF=2");
282 defines.push_back("__LITTLE_ENDIAN__");
283 }
284 else
285 {
286 defines.push_back("_CALL_ELF=1");
287 defines.push_back("__BIG_ENDIAN__");
288 }
289 }
290 break;
291
293 defines.push_back("_M_PPC");
294 break;
295
297 case flavourt::ARM:
298 case flavourt::ANSI:
299 break;
300
301 case flavourt::NONE:
303 }
304}
305
307{
308 arch_is_x86_family = false;
310 if(subarch=="arm64")
311 {
312 set_LP64();
314 }
315 else
316 {
317 set_ILP32();
319 }
320
322 char_is_unsigned=true;
323 NULL_is_zero=true;
324
325 switch(mode)
326 {
327 case flavourt::GCC:
328 case flavourt::CLANG:
329 if(subarch=="arm64")
330 defines.push_back("__aarch64__");
331 else
332 defines.push_back("__arm__");
333 if(subarch=="armhf")
334 defines.push_back("__ARM_PCS_VFP");
335 break;
336
338 if(subarch == "arm64")
339 defines.push_back("_M_ARM64");
340 else
341 defines.push_back("_M_ARM");
342 break;
343
345 case flavourt::ARM:
346 case flavourt::ANSI:
347 break;
348
349 case flavourt::NONE:
351 }
352}
353
355{
356 arch_is_x86_family = false;
358 set_LP64();
361 char_is_unsigned=false;
362 NULL_is_zero=true;
363
364 switch(mode)
365 {
366 case flavourt::GCC:
367 defines.push_back("__alpha__");
368 break;
369
371 defines.push_back("_M_ALPHA");
372 break;
373
374 case flavourt::CLANG:
376 case flavourt::ARM:
377 case flavourt::ANSI:
378 break;
379
380 case flavourt::NONE:
382 }
383}
384
386{
387 arch_is_x86_family = false;
389 if(subarch=="mipsel" ||
390 subarch=="mips" ||
391 subarch=="mipsn32el" ||
392 subarch=="mipsn32")
393 {
394 set_ILP32();
396 }
397 else
398 {
399 set_LP64();
401 }
402
403 if(subarch=="mipsel" ||
404 subarch=="mipsn32el" ||
405 subarch=="mips64el")
407 else
409
410 char_is_unsigned=false;
411 NULL_is_zero=true;
412
413 switch(mode)
414 {
415 case flavourt::GCC:
416 defines.push_back("__mips__");
417 defines.push_back("mips");
418 defines.push_back(
419 "_MIPS_SZPTR="+std::to_string(config.ansi_c.pointer_width));
420 break;
421
423 UNREACHABLE; // not supported by Visual Studio
424 break;
425
426 case flavourt::CLANG:
428 case flavourt::ARM:
429 case flavourt::ANSI:
430 break;
431
432 case flavourt::NONE:
434 }
435}
436
438{
439 arch_is_x86_family = false;
441 set_LP64();
443 long_double_width = 16 * 8;
444 char_is_unsigned = true;
445 NULL_is_zero = true;
446
447 switch(mode)
448 {
449 case flavourt::GCC:
450 defines.push_back("__riscv");
451 break;
452
454 case flavourt::CLANG:
456 case flavourt::ARM:
457 case flavourt::ANSI:
458 break;
459
460 case flavourt::NONE:
462 }
463}
464
466{
467 arch_is_x86_family = false;
469 set_ILP32();
472 char_is_unsigned=true;
473 NULL_is_zero=true;
474
475 switch(mode)
476 {
477 case flavourt::GCC:
478 defines.push_back("__s390__");
479 break;
480
482 UNREACHABLE; // not supported by Visual Studio
483 break;
484
485 case flavourt::CLANG:
487 case flavourt::ARM:
488 case flavourt::ANSI:
489 break;
490
491 case flavourt::NONE:
493 }
494}
495
497{
498 arch_is_x86_family = false;
500 set_LP64();
502 char_is_unsigned=true;
503 NULL_is_zero=true;
504
505 switch(mode)
506 {
507 case flavourt::GCC:
508 defines.push_back("__s390x__");
509 break;
510
512 UNREACHABLE; // not supported by Visual Studio
513 break;
514
515 case flavourt::CLANG:
517 case flavourt::ARM:
518 case flavourt::ANSI:
519 break;
520
521 case flavourt::NONE:
523 }
524}
525
527{
528 arch_is_x86_family = false;
530 if(subarch=="sparc64")
531 {
532 set_LP64();
534 }
535 else
536 {
537 set_ILP32();
539 }
540
542 char_is_unsigned=false;
543 NULL_is_zero=true;
544
545 switch(mode)
546 {
547 case flavourt::GCC:
548 defines.push_back("__sparc__");
549 if(subarch=="sparc64")
550 defines.push_back("__arch64__");
551 break;
552
554 UNREACHABLE; // not supported by Visual Studio
555 break;
556
557 case flavourt::CLANG:
559 case flavourt::ARM:
560 case flavourt::ANSI:
561 break;
562
563 case flavourt::NONE:
565 }
566}
567
569{
570 arch_is_x86_family = false;
572 set_LP64();
575 char_is_unsigned=false;
576 NULL_is_zero=true;
577
578 switch(mode)
579 {
580 case flavourt::GCC:
581 defines.push_back("__ia64__");
582 defines.push_back("_IA64");
583 defines.push_back("__IA64__");
584 break;
585
587 defines.push_back("_M_IA64");
588 break;
589
590 case flavourt::CLANG:
592 case flavourt::ARM:
593 case flavourt::ANSI:
594 break;
595
596 case flavourt::NONE:
598 }
599}
600
602{
603 arch_is_x86_family = true;
605 // This is a variant of x86_64 that has
606 // 32-bit long int and 32-bit pointers.
607 set_ILP32();
608 long_double_width=16*8; // different from i386
610 char_is_unsigned=false;
611 NULL_is_zero=true;
612
613 switch(mode)
614 {
615 case flavourt::GCC:
616 defines.push_back("__ILP32__");
617 defines.push_back("__x86_64");
618 defines.push_back("__x86_64__");
619 defines.push_back("__amd64__");
620 defines.push_back("__amd64");
621 break;
622
624 UNREACHABLE; // not supported by Visual Studio
625 break;
626
627 case flavourt::CLANG:
629 case flavourt::ARM:
630 case flavourt::ANSI:
631 break;
632
633 case flavourt::NONE:
635 }
636}
637
640{
641 arch_is_x86_family = false;
643 // The Renesas V850 is a 32-bit microprocessor used in
644 // many automotive applications. This spec is written from the
645 // architecture manual rather than having access to a running
646 // system. Thus some assumptions have been made.
647
648 set_ILP32();
649
650 // Technically, the V850's don't have floating-point at all.
651 // However, the RH850, aimed at automotive has both 32-bit and
652 // 64-bit IEEE-754 float.
653 double_width=8*8;
656
657 // Without information about the compiler and RTOS, these are guesses
658 char_is_unsigned=false;
659 NULL_is_zero=true;
660
661 // No preprocessor definitions due to lack of information
662}
663
665{
666 arch_is_x86_family = false;
668 set_ILP32();
669 long_double_width=8*8; // different from i386
671 char_is_unsigned=false;
672 NULL_is_zero=true;
673
674 switch(mode)
675 {
676 case flavourt::GCC:
677 defines.push_back("__hppa__");
678 break;
679
681 UNREACHABLE; // not supported by Visual Studio
682 break;
683
684 case flavourt::CLANG:
686 case flavourt::ARM:
687 case flavourt::ANSI:
688 break;
689
690 case flavourt::NONE:
692 }
693}
694
696{
697 arch_is_x86_family = false;
699 set_ILP32();
700 long_double_width=8*8; // different from i386
702 char_is_unsigned=false;
703 NULL_is_zero=true;
704
705 switch(mode)
706 {
707 case flavourt::GCC:
708 defines.push_back("__sh__");
709 defines.push_back("__SH4__");
710 break;
711
713 UNREACHABLE; // not supported by Visual Studio
714 break;
715
716 case flavourt::CLANG:
718 case flavourt::ARM:
719 case flavourt::ANSI:
720 break;
721
722 case flavourt::NONE:
724 }
725}
726
728{
729 arch_is_x86_family = false;
731 set_LP64();
733 long_double_width = 16 * 8;
734 char_is_unsigned = false;
735 NULL_is_zero = true;
736
737 switch(mode)
738 {
739 case flavourt::GCC:
740 defines.push_back("__loongarch__");
741 break;
742
744 UNREACHABLE; // not supported by Visual Studio
745 break;
746
748 case flavourt::CLANG:
749 case flavourt::ARM:
750 case flavourt::ANSI:
751 break;
752
753 case flavourt::NONE:
755 }
756}
757
759{
760 arch_is_x86_family = false;
762 set_ILP32();
764 long_double_width = 16 * 8;
765 char_is_unsigned = false;
766 NULL_is_zero = true;
767
768 switch(mode)
769 {
770 case flavourt::CLANG:
771 defines.push_back("__EMSCRIPTEN__");
772 break;
773
775 UNREACHABLE; // not supported by Visual Studio
776 break;
777
778 case flavourt::GCC:
780 case flavourt::ARM:
781 case flavourt::ANSI:
782 break;
783
784 case flavourt::NONE:
786 }
787}
788
790{
791#if defined(__APPLE__)
792 // By default, clang on the Mac builds C code in GNU C11
793 return c_standardt::C11;
794#elif defined(__FreeBSD__) || defined(__OpenBSD__)
795 // By default, clang on FreeBSD builds C code in GNU C99
796 // By default, clang on OpenBSD builds C code in C99
797 return c_standardt::C99;
798#else
799 // By default, gcc 5.4 or higher use gnu11; older versions use gnu89
800 return c_standardt::C11;
801#endif
802}
803
805{
806 // g++ 6.3 uses gnu++14
807 // g++ 5.4 uses gnu++98
808 // clang 6.0 uses c++14
809 #if defined _WIN32
811 #else
813 #endif
814}
815
817{
818 ansi_c.arch=arch;
819
820 if(arch=="none")
821 {
822 // the architecture for people who can't commit
825 ansi_c.NULL_is_zero=false;
826 ansi_c.arch_is_x86_family = false;
827 ansi_c.set_argument_evaluation_order();
828
829 if(sizeof(long int)==8)
830 ansi_c.set_64();
831 else
832 ansi_c.set_32();
833 }
834 else if(arch=="alpha")
835 ansi_c.set_arch_spec_alpha();
836 else if(arch=="arm64" ||
837 arch=="armel" ||
838 arch=="armhf" ||
839 arch=="arm")
840 ansi_c.set_arch_spec_arm(arch);
841 else if(arch=="mips64el" ||
842 arch=="mipsn32el" ||
843 arch=="mipsel" ||
844 arch=="mips64" ||
845 arch=="mipsn32" ||
846 arch=="mips")
847 ansi_c.set_arch_spec_mips(arch);
848 else if(arch=="powerpc" ||
849 arch=="ppc64" ||
850 arch=="ppc64le")
851 ansi_c.set_arch_spec_power(arch);
852 else if(arch == "riscv64")
853 ansi_c.set_arch_spec_riscv64();
854 else if(arch=="sparc" ||
855 arch=="sparc64")
856 ansi_c.set_arch_spec_sparc(arch);
857 else if(arch=="ia64")
858 ansi_c.set_arch_spec_ia64();
859 else if(arch=="s390x")
860 ansi_c.set_arch_spec_s390x();
861 else if(arch=="s390")
862 ansi_c.set_arch_spec_s390();
863 else if(arch=="x32")
864 ansi_c.set_arch_spec_x32();
865 else if(arch=="v850")
866 ansi_c.set_arch_spec_v850();
867 else if(arch=="hppa")
868 ansi_c.set_arch_spec_hppa();
869 else if(arch=="sh4")
870 ansi_c.set_arch_spec_sh4();
871 else if(arch=="x86_64")
872 ansi_c.set_arch_spec_x86_64();
873 else if(arch=="i386")
874 ansi_c.set_arch_spec_i386();
875 else if(arch == "loongarch64")
876 ansi_c.set_arch_spec_loongarch64();
877 else if(arch == "emscripten")
878 ansi_c.set_arch_spec_emscripten();
879 else
880 {
881 // We run on something new and unknown.
882 // We verify for i386 instead.
883 ansi_c.set_arch_spec_i386();
884 ansi_c.arch="i386";
885 }
886}
887
896 const std::string &argument,
897 const std::size_t pointer_width)
898{
899 const auto throw_for_reason = [&](const std::string &reason) {
901 "Value of \"" + argument + "\" given for object-bits is " + reason +
902 ". object-bits must be positive and less than the pointer width (" +
903 std::to_string(pointer_width) + ") ",
904 "--object_bits");
905 };
906 const auto object_bits = string2optional<unsigned int>(argument);
907 if(!object_bits)
908 throw_for_reason("not a valid unsigned integer");
909 if(*object_bits == 0 || *object_bits >= pointer_width)
910 throw_for_reason("out of range");
911
913 bv_encoding.object_bits = *object_bits;
915 return bv_encoding;
916}
917
918bool configt::set(const cmdlinet &cmdline)
919{
920 // defaults -- we match the architecture we have ourselves
921
922 cpp.cpp_standard=cppt::default_cpp_standard();
923
924 ansi_c.single_precision_constant=false;
925 ansi_c.allow_anonymous_struct_embedding = false;
926 ansi_c.for_has_scope=true; // C99 or later
927 ansi_c.ts_18661_3_Floatn_types=false;
928 ansi_c.__float128_is_keyword = false;
929 ansi_c.float16_type = false;
930 ansi_c.bf16_type = false;
931 ansi_c.fp16_type = false;
935 ansi_c.arch="none";
937 // NOLINTNEXTLINE(readability/casting)
938 ansi_c.NULL_is_zero=reinterpret_cast<size_t>(nullptr)==0;
939
940 // Default is ROUND_TO_EVEN, justified by C99:
941 // 1 At program startup the floating-point environment is initialized as
942 // prescribed by IEC 60559:
943 // - All floating-point exception status flags are cleared.
944 // - The rounding direction mode is rounding to nearest.
946
947 if(cmdline.isset("function"))
948 main=cmdline.get_value("function");
949
950 if(cmdline.isset('D'))
951 ansi_c.defines=cmdline.get_values('D');
952
953 if(cmdline.isset('I'))
954 ansi_c.include_paths=cmdline.get_values('I');
955
956 if(cmdline.isset("classpath"))
957 {
958 // Specifying -classpath or -cp overrides any setting of the
959 // CLASSPATH environment variable.
960 set_classpath(cmdline.get_value("classpath"));
961 }
962 else if(cmdline.isset("cp"))
963 {
964 // Specifying -classpath or -cp overrides any setting of the
965 // CLASSPATH environment variable.
966 set_classpath(cmdline.get_value("cp"));
967 }
968 else
969 {
970 // environment variable set?
971 const char *CLASSPATH=getenv("CLASSPATH");
972 if(CLASSPATH!=nullptr)
973 set_classpath(CLASSPATH);
974 else
975 set_classpath("."); // default
976 }
977
978 if(cmdline.isset("main-class"))
979 java.main_class=cmdline.get_value("main-class");
980
981 if(cmdline.isset("include"))
982 ansi_c.include_files=cmdline.get_values("include");
983
984 // the default architecture is the one we run on
985 irep_idt this_arch=this_architecture();
986 irep_idt arch=this_arch;
987
988 // let's pick an OS now
989 // the default is the one we run on
991 irep_idt os=this_os;
992
993 if(cmdline.isset("i386-linux"))
994 {
995 os="linux";
996 arch="i386";
997 }
998 else if(cmdline.isset("i386-win32") ||
999 cmdline.isset("win32"))
1000 {
1001 os="windows";
1002 arch="i386";
1003 }
1004 else if(cmdline.isset("winx64"))
1005 {
1006 os="windows";
1007 arch="x86_64";
1008 }
1009 else if(cmdline.isset("i386-macos"))
1010 {
1011 os="macos";
1012 arch="i386";
1013 }
1014 else if(cmdline.isset("ppc-macos"))
1015 {
1016 arch="powerpc";
1017 os="macos";
1018 }
1019
1020 if(cmdline.isset("arch"))
1021 {
1022 arch=cmdline.get_value("arch");
1023 }
1024
1025 if(cmdline.isset("os"))
1026 {
1027 os=cmdline.get_value("os");
1028 }
1029
1030 if(os=="windows")
1031 {
1032 // Cygwin uses GCC throughout, use i386-linux
1033 // MinGW needs --win32 --gcc
1036
1037 if(cmdline.isset("gcc"))
1038 {
1039 // There are gcc versions that target Windows (MinGW for example),
1040 // and we support that.
1043
1044 // enable Cygwin
1045 #ifdef _WIN32
1046 ansi_c.defines.push_back("__CYGWIN__");
1047 #endif
1048
1049 // MinGW has extra defines
1050 ansi_c.defines.push_back("__int64=long long");
1051 }
1052 else
1053 {
1054 // On Windows, our default is Visual Studio.
1055 // On FreeBSD, it's clang.
1056 // On anything else, it's GCC as the preprocessor,
1057 // but we recognize the Visual Studio language,
1058 // which is somewhat inconsistent.
1059 #ifdef _WIN32
1062#elif defined(__FreeBSD__) || defined(__OpenBSD__)
1065#else
1068#endif
1069
1070 cpp.cpp_standard = cppt::cpp_standardt::CPP14;
1071 }
1072 }
1073 else if(os=="macos")
1074 {
1079 // configure_gcc sets these with additional version-of-clang level of
1080 // detail, but the below are reasonable defaults for modern clang
1081 // installations
1082 ansi_c.__float128_is_keyword = true;
1083 ansi_c.float16_type = true;
1084 ansi_c.bf16_type = true;
1085 ansi_c.fp16_type = true;
1086 }
1087 else if(os == "linux" || os == "solaris" || os == "netbsd" || os == "hurd")
1088 {
1093 }
1094 else if(os == "freebsd" || os == "openbsd")
1095 {
1100 // configure_gcc sets these with additional version-of-clang level of
1101 // detail, but the below are reasonable defaults for modern clang
1102 // installations
1103 ansi_c.__float128_is_keyword = true;
1104 ansi_c.float16_type = true;
1105 ansi_c.bf16_type = true;
1106 ansi_c.fp16_type = true;
1107 }
1108 else
1109 {
1110 // give up, but use reasonable defaults
1115 }
1116
1117 if(ansi_c.preprocessor == ansi_ct::preprocessort::GCC)
1118 ansi_c.gcc__float128_type = true;
1119
1120 set_arch(arch);
1121
1122 if(os=="windows")
1123 {
1124 // note that sizeof(void *)==8, but sizeof(long)==4!
1125 if(arch=="x86_64")
1126 ansi_c.set_LLP64();
1127
1128 // On Windows, wchar_t is unsigned 16 bit, regardless
1129 // of the compiler used.
1130 ansi_c.wchar_t_width=2*8;
1131 ansi_c.wchar_t_is_unsigned=true;
1132
1133 // long double is the same as double in Visual Studio,
1134 // but it's 16 bytes with GCC with the 64-bit target.
1135 if(arch == "x86_64" && cmdline.isset("gcc"))
1136 ansi_c.long_double_width=16*8;
1137 else
1138 ansi_c.long_double_width=8*8;
1139 }
1140 else if(os == "macos" && arch == "arm64")
1141 {
1142 // https://developer.apple.com/documentation/xcode/
1143 // writing_arm64_code_for_apple_platforms#//apple_ref/doc/uid/TP40013702-SW1
1144 ansi_c.char_is_unsigned = false;
1145 ansi_c.long_double_width = 8 * 8;
1146 }
1147 else if(
1148 os == "freebsd" &&
1149 (arch == "powerpc" || arch == "ppc64" || arch == "ppc64le"))
1150 {
1151 // FreeBSD/PowerPC does not use the 128-bit long double assumed by
1152 // set_arch_spec_power(): it is 64-bit, except on powerpc64le since
1153 // FreeBSD 16.0, where it is IEEE binary128. The width is a property
1154 // of the release, which the target triple does not carry, so follow
1155 // the toolchain when verifying natively and assume FreeBSD >= 16.0
1156 // when cross-verifying.
1157 if(arch == this_arch && os == this_os)
1158 ansi_c.long_double_width = sizeof(long double) * CHAR_BIT;
1159 else if(arch == "ppc64le")
1160 ansi_c.long_double_width = 16 * 8;
1161 else
1162 ansi_c.long_double_width = 8 * 8;
1163 }
1164
1165 // Let's check some of the type widths in case we run
1166 // the same architecture and OS that we are verifying for.
1167 if(arch==this_arch && os==this_os)
1168 {
1169 INVARIANT(
1170 ansi_c.int_width == sizeof(int) * CHAR_BIT,
1171 "int width shall be equal to the system int width");
1172 INVARIANT(
1173 ansi_c.long_int_width == sizeof(long) * CHAR_BIT,
1174 "long int width shall be equal to the system long int width");
1175 INVARIANT(
1176 ansi_c.bool_width == sizeof(bool) * CHAR_BIT,
1177 "bool width shall be equal to the system bool width");
1178 INVARIANT(
1179 ansi_c.char_width == sizeof(char) * CHAR_BIT,
1180 "char width shall be equal to the system char width");
1181 INVARIANT(
1182 ansi_c.short_int_width == sizeof(short) * CHAR_BIT,
1183 "short int width shall be equal to the system short int width");
1184 INVARIANT(
1185 ansi_c.long_long_int_width == sizeof(long long) * CHAR_BIT,
1186 "long long int width shall be equal to the system long long int width");
1187 INVARIANT(
1188 ansi_c.pointer_width == sizeof(void *) * CHAR_BIT,
1189 "pointer width shall be equal to the system pointer width");
1190 INVARIANT(
1191 ansi_c.single_width == sizeof(float) * CHAR_BIT,
1192 "float width shall be equal to the system float width");
1193 INVARIANT(
1194 ansi_c.double_width == sizeof(double) * CHAR_BIT,
1195 "double width shall be equal to the system double width");
1196 INVARIANT(
1197 ansi_c.char_is_unsigned ==
1198 (static_cast<char>((1 << CHAR_BIT) - 1) == (1 << CHAR_BIT) - 1),
1199 "char_is_unsigned flag shall indicate system char unsignedness");
1200
1201#ifndef _WIN32
1202 // On Windows, long double width varies by compiler
1203 INVARIANT(
1204 ansi_c.long_double_width == sizeof(long double) * CHAR_BIT,
1205 "long double width shall be equal to the system long double width");
1206#endif
1207 }
1208
1209 // the following allows overriding the defaults
1210
1211 if(cmdline.isset("16"))
1212 ansi_c.set_16();
1213
1214 if(cmdline.isset("32"))
1215 ansi_c.set_32();
1216
1217 if(cmdline.isset("64"))
1218 ansi_c.set_64();
1219
1220 if(cmdline.isset("LP64"))
1221 ansi_c.set_LP64(); // int=32, long=64, pointer=64
1222
1223 if(cmdline.isset("ILP64"))
1224 ansi_c.set_ILP64(); // int=64, long=64, pointer=64
1225
1226 if(cmdline.isset("LLP64"))
1227 ansi_c.set_LLP64(); // int=32, long=32, pointer=64
1228
1229 if(cmdline.isset("ILP32"))
1230 ansi_c.set_ILP32(); // int=32, long=32, pointer=32
1231
1232 if(cmdline.isset("LP32"))
1233 ansi_c.set_LP32(); // int=16, long=32, pointer=32
1234
1235 if(cmdline.isset("string-abstraction"))
1236 ansi_c.string_abstraction=true;
1237 else
1238 ansi_c.string_abstraction=false;
1239
1240 if(cmdline.isset("dfcc-debug-lib"))
1241 ansi_c.dfcc_debug_lib = true;
1242 else
1243 ansi_c.dfcc_debug_lib = false;
1244
1245 if(cmdline.isset("dfcc-simple-invalid-pointer-model"))
1246 ansi_c.simple_invalid_pointer_model = true;
1247 else
1248 ansi_c.simple_invalid_pointer_model = false;
1249
1250 if(cmdline.isset("no-library"))
1252
1253 if(cmdline.isset("little-endian"))
1255
1256 if(cmdline.isset("big-endian"))
1258
1259 if(cmdline.isset("little-endian") &&
1260 cmdline.isset("big-endian"))
1261 return true;
1262
1263 if(cmdline.isset("unsigned-char"))
1264 ansi_c.char_is_unsigned=true;
1265
1266 if(cmdline.isset("round-to-even") ||
1267 cmdline.isset("round-to-nearest"))
1268 ansi_c.rounding_mode=ieee_floatt::ROUND_TO_EVEN;
1269
1270 if(cmdline.isset("round-to-plus-inf"))
1272
1273 if(cmdline.isset("round-to-minus-inf"))
1275
1276 if(cmdline.isset("round-to-zero"))
1277 ansi_c.rounding_mode=ieee_floatt::ROUND_TO_ZERO;
1278
1279 if(cmdline.isset("object-bits"))
1280 {
1282 cmdline.get_value("object-bits"), ansi_c.pointer_width);
1283 }
1284
1285 if(cmdline.isset("malloc-fail-assert") && cmdline.isset("malloc-fail-null"))
1286 {
1288 "at most one malloc failure mode is acceptable", "--malloc-fail-null"};
1289 }
1290 if(cmdline.isset("malloc-fail-null"))
1291 ansi_c.malloc_failure_mode = ansi_c.malloc_failure_mode_return_null;
1292 if(cmdline.isset("malloc-fail-assert"))
1293 ansi_c.malloc_failure_mode = ansi_c.malloc_failure_mode_assert_then_assume;
1294
1295 if(cmdline.isset("malloc-may-fail"))
1296 {
1297 ansi_c.malloc_may_fail = true;
1298 }
1299 if(cmdline.isset("no-malloc-may-fail"))
1300 {
1301 ansi_c.malloc_may_fail = false;
1302 ansi_c.malloc_failure_mode = ansi_ct::malloc_failure_mode_none;
1303 }
1304
1305 if(cmdline.isset("c89"))
1306 ansi_c.set_c89();
1307
1308 if(cmdline.isset("c99"))
1309 ansi_c.set_c99();
1310
1311 if(cmdline.isset("c11"))
1312 ansi_c.set_c11();
1313
1314 if(cmdline.isset("c17"))
1315 ansi_c.set_c17();
1316
1317 if(cmdline.isset("c23"))
1318 ansi_c.set_c23();
1319
1320 if(cmdline.isset("cpp98"))
1321 cpp.set_cpp98();
1322
1323 if(cmdline.isset("cpp03"))
1324 cpp.set_cpp03();
1325
1326 if(cmdline.isset("cpp11"))
1327 cpp.set_cpp11();
1328
1329 // set the upper bound for argc
1330 if(os == "windows")
1331 {
1332 // On Windows, CreateProcess accepts no more than 32767 characters, so make
1333 // that a hard limit.
1334 ansi_c.max_argc = mp_integer{32767};
1335 }
1336 else
1337 {
1338 // For other systems assume argc is no larger than the what would make argv
1339 // the largest representable array (when using signed integers to represent
1340 // array sizes):
1341 // 2^(pointer_width - 1) / (pointer_width / char_width) is the maximum
1342 // number of argv elements sysconf(ARG_MAX) is likely much lower than this,
1343 // but we don't know that value for the verification target platform.
1344 const auto pointer_bits_2log =
1345 address_bits(ansi_c.pointer_width / ansi_c.char_width);
1346 if(ansi_c.pointer_width - pointer_bits_2log - 1 <= ansi_c.int_width)
1347 {
1348 ansi_c.max_argc =
1349 power(2, config.ansi_c.int_width - pointer_bits_2log - 1);
1350 }
1351 // otherwise we leave argc unconstrained
1352 }
1353
1354 return false;
1355}
1356
1358{
1359 // clang-format off
1360 switch(os)
1361 {
1362 case ost::OS_LINUX: return "linux";
1363 case ost::OS_MACOS: return "macos";
1364 case ost::OS_WIN: return "win";
1365 case ost::NO_OS: return "none";
1366 }
1367 // clang-format on
1368
1370}
1371
1373{
1374 if(os=="linux")
1375 return ost::OS_LINUX;
1376 else if(os=="macos")
1377 return ost::OS_MACOS;
1378 else if(os=="win")
1379 return ost::OS_WIN;
1380 else
1381 return ost::NO_OS;
1382}
1383
1385 const namespacet &ns,
1386 const std::string &what)
1387{
1388 const irep_idt id=CPROVER_PREFIX "architecture_"+what;
1389 const symbolt *symbol;
1390
1391 const bool not_found = ns.lookup(id, symbol);
1392 INVARIANT(!not_found, id2string(id) + " must be in namespace");
1393
1394 const exprt &tmp=symbol->value;
1395
1396 INVARIANT(
1397 tmp.id() == ID_address_of &&
1398 to_address_of_expr(tmp).object().id() == ID_index &&
1399 to_index_expr(to_address_of_expr(tmp).object()).array().id() ==
1400 ID_string_constant,
1401 "symbol table configuration entry '" + id2string(id) +
1402 "' must be a string constant");
1403
1404 return to_index_expr(to_address_of_expr(tmp).object()).array().get(ID_value);
1405}
1406
1407static unsigned unsigned_from_ns(
1408 const namespacet &ns,
1409 const std::string &what)
1410{
1411 const irep_idt id=CPROVER_PREFIX "architecture_"+what;
1412 const symbolt *symbol;
1413
1414 const bool not_found = ns.lookup(id, symbol);
1415 INVARIANT(!not_found, id2string(id) + " must be in namespace");
1416
1417 exprt tmp=symbol->value;
1418 simplify(tmp, ns);
1419
1420 INVARIANT(
1421 tmp.is_constant(),
1422 "symbol table configuration entry '" + id2string(id) +
1423 "' must be a constant");
1424
1425 mp_integer int_value;
1426
1427 const bool error = to_integer(to_constant_expr(tmp), int_value);
1428 INVARIANT(
1429 !error,
1430 "symbol table configuration entry '" + id2string(id) +
1431 "' must be convertible to mp_integer");
1432
1433 return numeric_cast_v<unsigned>(int_value);
1434}
1435
1437{
1438 // maybe not compiled from C/C++
1439 if(symbol_table.symbols.find(CPROVER_PREFIX "architecture_" "int_width")==
1440 symbol_table.symbols.end())
1441 return;
1442
1443 namespacet ns(symbol_table);
1444
1445 // clear defines
1446 ansi_c.defines.clear();
1447
1448 // first set architecture to get some defaults
1449 if(symbol_table.symbols.find(CPROVER_PREFIX "architecture_" "arch")==
1450 symbol_table.symbols.end())
1452 else
1453 set_arch(string_from_ns(ns, "arch"));
1454
1455 ansi_c.int_width=unsigned_from_ns(ns, "int_width");
1456 ansi_c.long_int_width=unsigned_from_ns(ns, "long_int_width");
1457 ansi_c.bool_width=1*8;
1458 ansi_c.char_width=unsigned_from_ns(ns, "char_width");
1459 ansi_c.short_int_width=unsigned_from_ns(ns, "short_int_width");
1460 ansi_c.long_long_int_width=unsigned_from_ns(ns, "long_long_int_width");
1461 ansi_c.pointer_width=unsigned_from_ns(ns, "pointer_width");
1462 ansi_c.single_width=unsigned_from_ns(ns, "single_width");
1463 ansi_c.double_width=unsigned_from_ns(ns, "double_width");
1464 ansi_c.long_double_width=unsigned_from_ns(ns, "long_double_width");
1465 ansi_c.wchar_t_width=unsigned_from_ns(ns, "wchar_t_width");
1466
1467 ansi_c.char_is_unsigned=unsigned_from_ns(ns, "char_is_unsigned")!=0;
1468 ansi_c.wchar_t_is_unsigned=unsigned_from_ns(ns, "wchar_t_is_unsigned")!=0;
1469 // for_has_scope, single_precision_constant, rounding_mode,
1470 // ts_18661_3_Floatn_types, __float128_is_keyword, float16_type, bf16_type,
1471 // fp16_type are not architectural features, and thus not stored in namespace
1472
1473 ansi_c.alignment=unsigned_from_ns(ns, "alignment");
1474
1475 ansi_c.memory_operand_size=unsigned_from_ns(ns, "memory_operand_size");
1476
1477 ansi_c.endianness=(ansi_ct::endiannesst)unsigned_from_ns(ns, "endianness");
1478
1479 if(symbol_table.symbols.find(CPROVER_PREFIX "architecture_" "os")==
1480 symbol_table.symbols.end())
1482 else
1484
1485 ansi_c.NULL_is_zero = unsigned_from_ns(ns, "NULL_is_zero") != 0;
1486
1487 // goto binaries created before this architecture parameter was introduced
1488 // may lack the symbol; keep the default set via set_arch above in that
1489 // case. Note that this fallback depends on the loading tool's compiler
1490 // flavour (`mode` is not stored in goto binaries), so, e.g., an old
1491 // Clang-produced x86-family binary loaded with GCC defaults is modelled
1492 // as right-to-left.
1493 if(
1494 symbol_table.symbols.find(CPROVER_PREFIX "architecture_"
1495 "argument_evaluation_order") !=
1496 symbol_table.symbols.end())
1497 {
1498 ansi_c.argument_evaluation_order =
1500 unsigned_from_ns(ns, "argument_evaluation_order"));
1501 }
1502
1503 // mode, preprocessor (and all preprocessor command line options),
1504 // lib, string_abstraction not stored in namespace
1505
1507}
1508
1512 const symbol_table_baset &symbol_table)
1513{
1514 // has been overridden by command line option,
1515 // thus do not apply language defaults
1516 if(!bv_encoding.is_object_bits_default)
1517 return;
1518
1519 // set object_bits according to entry point language
1520 if(const auto maybe_symbol=symbol_table.lookup(CPROVER_PREFIX "_start"))
1521 {
1522 const symbolt &entry_point_symbol=*maybe_symbol;
1523
1524 if(entry_point_symbol.mode==ID_java)
1525 bv_encoding.object_bits=java.default_object_bits;
1526 else if(entry_point_symbol.mode==ID_C)
1527 bv_encoding.object_bits=ansi_c.default_object_bits;
1528 else if(entry_point_symbol.mode==ID_cpp)
1529 bv_encoding.object_bits=cpp.default_object_bits;
1531 0<bv_encoding.object_bits && bv_encoding.object_bits<ansi_c.pointer_width,
1532 "object_bits should fit into pointer width");
1533 }
1534}
1535
1537{
1538 return "Running with "+std::to_string(bv_encoding.object_bits)+
1539 " object bits, "+
1540 std::to_string(ansi_c.pointer_width-bv_encoding.object_bits)+
1541 " offset bits ("+
1542 (bv_encoding.is_object_bits_default ? "default" : "user-specified")+
1543 ")";
1544}
1545
1546// clang-format off
1548{
1549 irep_idt this_arch;
1550
1551 // following http://wiki.debian.org/ArchitectureSpecificsMemo
1552
1553 #ifdef __alpha__
1554 this_arch = "alpha";
1555 #elif defined(__armel__)
1556 this_arch = "armel";
1557 #elif defined(__aarch64__)
1558 this_arch = "arm64";
1559 #elif defined(__arm__)
1560 #ifdef __ARM_PCS_VFP
1561 this_arch = "armhf"; // variant of arm with hard float
1562 #else
1563 this_arch = "arm";
1564 #endif
1565 #elif defined(_MIPSEL)
1566 #if _MIPS_SIM==_ABIO32
1567 this_arch = "mipsel";
1568 #elif _MIPS_SIM==_ABIN32
1569 this_arch = "mipsn32el";
1570 #else
1571 this_arch = "mips64el";
1572 #endif
1573 #elif defined(__mips__)
1574 #if _MIPS_SIM==_ABIO32
1575 this_arch = "mips";
1576 #elif _MIPS_SIM==_ABIN32
1577 this_arch = "mipsn32";
1578 #else
1579 this_arch = "mips64";
1580 #endif
1581 #elif defined(__powerpc__)
1582 #if defined(__ppc64__) || defined(__PPC64__) || \
1583 defined(__powerpc64__) || defined(__POWERPC64__)
1584 #ifdef __LITTLE_ENDIAN__
1585 this_arch = "ppc64le";
1586 #else
1587 this_arch = "ppc64";
1588 #endif
1589 #else
1590 this_arch = "powerpc";
1591 #endif
1592 #elif defined(__riscv)
1593 this_arch = "riscv64";
1594 #elif defined(__sparc__)
1595 #ifdef __arch64__
1596 this_arch = "sparc64";
1597 #else
1598 this_arch = "sparc";
1599 #endif
1600 #elif defined(__ia64__)
1601 this_arch = "ia64";
1602 #elif defined(__s390x__)
1603 this_arch = "s390x";
1604 #elif defined(__s390__)
1605 this_arch = "s390";
1606 #elif defined(__x86_64__)
1607 #ifdef __ILP32__
1608 this_arch = "x32"; // variant of x86_64 with 32-bit pointers
1609 #else
1610 this_arch = "x86_64";
1611 #endif
1612 #elif defined(__i386__)
1613 this_arch = "i386";
1614 #elif defined(_WIN64)
1615 this_arch = "x86_64";
1616 #elif defined(_WIN32)
1617 this_arch = "i386";
1618 #elif defined(__hppa__)
1619 this_arch = "hppa";
1620 #elif defined(__sh__)
1621 this_arch = "sh4";
1622 #elif defined(__loongarch__)
1623 this_arch = "loongarch64";
1624 #elif defined(__EMSCRIPTEN__)
1625 this_arch = "emscripten";
1626 #else
1627 // something new and unknown!
1628 this_arch = "unknown";
1629 #endif
1630
1631 return this_arch;
1632}
1633// clang-format on
1634
1635void configt::set_classpath(const std::string &cp)
1636{
1637// These are separated by colons on Unix, and semicolons on
1638// Windows.
1639#ifdef _WIN32
1640 const char cp_separator = ';';
1641#else
1642 const char cp_separator = ':';
1643#endif
1644
1645 std::vector<std::string> class_path =
1646 split_string(cp, cp_separator);
1647 java.classpath.insert(
1648 java.classpath.end(), class_path.begin(), class_path.end());
1649}
1650
1652{
1653 irep_idt this_os;
1654
1655 #ifdef _WIN32
1656 this_os="windows";
1657 #elif __APPLE__
1658 this_os="macos";
1659 #elif __FreeBSD__
1660 this_os="freebsd";
1661#elif __OpenBSD__
1662 this_os = "openbsd";
1663#elif __NetBSD__
1664 this_os = "netbsd";
1665#elif __linux__
1666 this_os="linux";
1667#elif __SVR4
1668 this_os="solaris";
1669#elif __gnu_hurd__
1670 this_os = "hurd";
1671#elif __EMSCRIPTEN__
1672 this_os = "emscripten";
1673#else
1674 this_os="unknown";
1675#endif
1676
1677 return this_os;
1678}
1679
1693{
1694 PRECONDITION(ansi_c.pointer_width >= 1);
1695 PRECONDITION(bv_encoding.object_bits < ansi_c.pointer_width);
1696 PRECONDITION(bv_encoding.object_bits >= 1);
1697 const auto offset_bits = ansi_c.pointer_width - bv_encoding.object_bits;
1698 // We require the offset to be able to express upto allocation_size - 1,
1699 // but also down to -allocation_size, therefore the size is allowable
1700 // is number of bits, less the signed bit.
1701 const auto bits_for_positive_offset = offset_bits - 1;
1702 return ((mp_integer)1) << (mp_integer)bits_for_positive_offset;
1703}
configt config
Definition config.cpp:25
std::size_t address_bits(const mp_integer &size)
ceil(log2(size))
bool to_integer(const constant_exprt &expr, mp_integer &int_value)
Convert a constant expression expr to an arbitrary-precision integer.
mp_integer power(const mp_integer &base, const mp_integer &exponent)
A multi-precision implementation of the power operator.
Target numeric_cast_v(const mp_integer &arg)
Convert an mp_integer to integral type Target An invariant will fail if the conversion is not possibl...
std::string get_value(char option) const
Definition cmdline.cpp:48
virtual bool isset(char option) const
Definition cmdline.cpp:30
const std::list< std::string > & get_values(const std::string &option) const
Definition cmdline.cpp:135
Globally accessible architectural configuration.
Definition config.h:144
void set_object_bits_from_symbol_table(const symbol_table_baset &)
Sets the number of bits used for object addresses.
Definition config.cpp:1511
void set_arch(const irep_idt &)
Definition config.cpp:816
struct configt::bv_encodingt bv_encoding
bool set(const cmdlinet &cmdline)
Definition config.cpp:918
std::string object_bits_info()
Definition config.cpp:1536
void set_classpath(const std::string &cp)
Definition config.cpp:1635
mp_integer max_malloc_size() const
The maximum allocation size is determined by the number of bits that are left in the pointer of width...
Definition config.cpp:1692
void set_from_symbol_table(const symbol_table_baset &)
Definition config.cpp:1436
static irep_idt this_architecture()
Definition config.cpp:1547
std::optional< std::string > main
Definition config.h:417
struct configt::javat java
struct configt::cppt cpp
static irep_idt this_operating_system()
Definition config.cpp:1651
struct configt::ansi_ct ansi_c
Base class for all expressions.
Definition expr.h:57
bool is_constant() const
Return whether the expression is a constant.
Definition expr.h:213
exprt & array()
Definition std_expr.h:1461
Thrown when users pass incorrect command line arguments, for example passing no files to analysis or ...
const irep_idt & get(const irep_idt &name) const
Definition irep.cpp:44
const irep_idt & id() const
Definition irep.h:388
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition namespace.h:91
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
The symbol table base class interface.
const symbolt * lookup(const irep_idt &name) const
Find a symbol in the symbol table for read-only access.
const symbolst & symbols
Read-only field, used to look up symbols given their names.
Symbol table entry.
Definition symbol.h:28
exprt value
Initial value of symbol.
Definition symbol.h:34
irep_idt mode
Language mode.
Definition symbol.h:49
configt::bv_encodingt parse_object_bits_encoding(const std::string &argument, const std::size_t pointer_width)
Parses the object_bits argument from the command line arguments.
Definition config.cpp:895
static unsigned unsigned_from_ns(const namespacet &ns, const std::string &what)
Definition config.cpp:1407
static irep_idt string_from_ns(const namespacet &ns, const std::string &what)
Definition config.cpp:1384
configt config
Definition config.cpp:25
#define CPROVER_PREFIX
const std::string & id2string(const irep_idt &d)
Definition irep.h:44
API to expression classes for Pointers.
const address_of_exprt & to_address_of_expr(const exprt &expr)
Cast an exprt to an address_of_exprt.
bool simplify(exprt &expr, const namespacet &ns)
BigInt mp_integer
Definition smt_terms.h:17
#define UNREACHABLE
This should be used to mark dead code.
Definition invariant.h:525
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
Definition invariant.h:534
#define PRECONDITION(CONDITION)
Definition invariant.h:463
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
Definition invariant.h:423
const index_exprt & to_index_expr(const exprt &expr)
Cast an exprt to an index_exprt.
Definition std_expr.h:1494
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
Definition std_expr.h:3078
std::optional< T > string2optional(std::string_view str, int base=10)
Convert a string to an integer, given the base of the representation, works with signed and unsigned ...
Definition string2int.h:66
void split_string(std::string_view s, char delim, std::vector< std::string > &result, bool strip, bool remove_empty)
std::size_t long_double_width
Definition config.h:158
void set_arch_spec_x32()
Definition config.cpp:601
void set_arch_spec_riscv64()
Definition config.cpp:437
endiannesst endianness
Definition config.h:234
void set_arch_spec_sh4()
Definition config.cpp:695
void set_arch_spec_loongarch64()
Definition config.cpp:727
void set_ILP32()
int=32, long=32, pointer=32
Definition config.cpp:111
void set_arch_spec_v850()
Sets up the widths of variables for the Renesas V850.
Definition config.cpp:639
bool wchar_t_is_unsigned
Definition config.h:162
argument_evaluation_ordert argument_evaluation_order
Definition config.h:252
void set_arch_spec_hppa()
Definition config.cpp:664
static std::string os_to_string(ost)
Definition config.cpp:1357
bool arch_is_x86_family
Definition config.h:258
std::size_t pointer_width
Definition config.h:155
void set_ILP64()
int=64, long=64, pointer=64
Definition config.cpp:71
void set_arch_spec_sparc(const irep_idt &subarch)
Definition config.cpp:526
static ost string_to_os(const std::string &)
Definition config.cpp:1372
std::list< std::string > defines
Definition config.h:320
void set_argument_evaluation_order()
Sets the architectural parameter recording the order in which compilers evaluate the arguments of a f...
Definition config.cpp:157
void set_LLP64()
int=32, long=32, pointer=64
Definition config.cpp:91
void set_arch_spec_arm(const irep_idt &subarch)
Definition config.cpp:306
std::size_t wchar_t_width
Definition config.h:159
@ malloc_failure_mode_none
Definition config.h:344
std::size_t double_width
Definition config.h:157
bool char_is_unsigned
Definition config.h:162
static c_standardt default_c_standard()
Definition config.cpp:789
void set_arch_spec_alpha()
Definition config.cpp:354
std::size_t alignment
Definition config.h:222
void set_arch_spec_power(const irep_idt &subarch)
Definition config.cpp:243
std::size_t bool_width
Definition config.h:151
void set_arch_spec_s390()
Definition config.cpp:465
void set_LP64()
int=32, long=64, pointer=64
Definition config.cpp:47
void set_arch_spec_x86_64()
Definition config.cpp:203
void set_LP32()
int=16, long=32, pointer=32
Definition config.cpp:131
std::size_t memory_operand_size
Definition config.h:226
std::size_t long_long_int_width
Definition config.h:154
void set_arch_spec_s390x()
Definition config.cpp:496
bool NULL_is_zero
Definition config.h:277
std::size_t long_int_width
Definition config.h:150
void set_arch_spec_mips(const irep_idt &subarch)
Definition config.cpp:385
std::size_t single_width
Definition config.h:156
void set_arch_spec_i386()
Definition config.cpp:169
std::size_t short_int_width
Definition config.h:153
std::size_t char_width
Definition config.h:152
flavourt mode
Definition config.h:307
std::size_t int_width
Definition config.h:149
void set_arch_spec_ia64()
Definition config.cpp:568
void set_arch_spec_emscripten()
Definition config.cpp:758
bool is_object_bits_default
Definition config.h:413
std::size_t object_bits
Definition config.h:412
static cpp_standardt default_cpp_standard()
Definition config.cpp:804
Author: Diffblue Ltd.
dstringt irep_idt