-
Notifications
You must be signed in to change notification settings - Fork 285
on-demand definitions for compiler-built-in functions #1910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4a5b952
1711345
15ec42f
80ee0b1
17d9897
2c8ae92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,11 @@ Author: Daniel Kroening, kroening@kroening.com | |
|
|
||
| #include <util/config.h> | ||
|
|
||
| const char gcc_builtin_headers_types[]= | ||
| "# 1 \"gcc_builtin_headers_types.h\"\n" | ||
| #include "gcc_builtin_headers_types.inc" | ||
| ; // NOLINT(whitespace/semicolon) | ||
|
|
||
| const char gcc_builtin_headers_generic[]= | ||
| "# 1 \"gcc_builtin_headers_generic.h\"\n" | ||
| #include "gcc_builtin_headers_generic.inc" | ||
|
|
@@ -89,6 +94,10 @@ const char clang_builtin_headers[]= | |
| #include "clang_builtin_headers.inc" | ||
| ; // NOLINT(whitespace/semicolon) | ||
|
|
||
| const char windows_builtin_headers[]= | ||
| "int __noop();\n" | ||
|
||
| "int __assume(int);\n"; | ||
|
|
||
| static std::string architecture_string(const std::string &value, const char *s) | ||
| { | ||
| return std::string("const char *__CPROVER_architecture_")+ | ||
|
|
@@ -257,13 +266,7 @@ void ansi_c_internal_additions(std::string &code) | |
| config.ansi_c.mode==configt::ansi_ct::flavourt::APPLE || | ||
| config.ansi_c.mode==configt::ansi_ct::flavourt::ARM) | ||
| { | ||
| code+=gcc_builtin_headers_generic; | ||
| code+=gcc_builtin_headers_math; | ||
| code+=gcc_builtin_headers_mem_string; | ||
| code+=gcc_builtin_headers_omp; | ||
| code+=gcc_builtin_headers_tm; | ||
| code+=gcc_builtin_headers_ubsan; | ||
| code+=clang_builtin_headers; | ||
| code+=gcc_builtin_headers_types; | ||
|
|
||
| // there are many more, e.g., look at | ||
| // https://developer.apple.com/library/mac/#documentation/developertools/gcc-4.0.1/gcc/Target-Builtins.html | ||
|
|
@@ -274,37 +277,6 @@ void ansi_c_internal_additions(std::string &code) | |
| { | ||
| if(config.ansi_c.mode==configt::ansi_ct::flavourt::APPLE) | ||
| code+="typedef double __float128;\n"; // clang doesn't do __float128 | ||
|
|
||
| code+=gcc_builtin_headers_ia32; | ||
| code+=gcc_builtin_headers_ia32_2; | ||
| code+=gcc_builtin_headers_ia32_3; | ||
| code+=gcc_builtin_headers_ia32_4; | ||
| } | ||
| else if(config.ansi_c.arch=="arm64" || | ||
| config.ansi_c.arch=="armel" || | ||
| config.ansi_c.arch=="armhf" || | ||
| config.ansi_c.arch=="arm") | ||
| { | ||
| code+=gcc_builtin_headers_arm; | ||
| } | ||
| else if(config.ansi_c.arch=="alpha") | ||
| { | ||
| code+=gcc_builtin_headers_alpha; | ||
| } | ||
| else if(config.ansi_c.arch=="mips64el" || | ||
| config.ansi_c.arch=="mipsn32el" || | ||
| config.ansi_c.arch=="mipsel" || | ||
| config.ansi_c.arch=="mips64" || | ||
| config.ansi_c.arch=="mipsn32" || | ||
| config.ansi_c.arch=="mips") | ||
| { | ||
| code+=gcc_builtin_headers_mips; | ||
| } | ||
| else if(config.ansi_c.arch=="powerpc" || | ||
| config.ansi_c.arch=="ppc64" || | ||
| config.ansi_c.arch=="ppc64le") | ||
| { | ||
| code+=gcc_builtin_headers_power; | ||
| } | ||
|
|
||
| // On 64-bit systems, gcc has typedefs | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While at this, would it be possible to introduce a Makefile variable holding all the header files? As is, the same list of files appears three times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done