diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-02-02 18:42:48 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-02-02 18:42:48 +0000 |
commit | 3ec6663be0ed79325d9d865a31f514e2f4e218fe (patch) | |
tree | 0349663331af938bf06aa107523d24ff9f951ed5 /clang/test/Modules/Inputs | |
parent | 248bc72737797c34d22f7d0fce34d87339b7c1ea (diff) | |
download | bcm5719-llvm-3ec6663be0ed79325d9d865a31f514e2f4e218fe.tar.gz bcm5719-llvm-3ec6663be0ed79325d9d865a31f514e2f4e218fe.zip |
Back out my heinous hack that tricked the module generation mechanism
into using non-absolute system includes (<foo>)...
... and introduce another hack that is simultaneously more heineous
and more effective. We whitelist Clang-supplied headers that augment
or override system headers (such as float.h, stdarg.h, and
tgmath.h). For these headers, Clang does not provide a module
mapping. Instead, a system-supplied module map can refer to these
headers in a system module, and Clang will look both in its own
include directory and wherever the system-supplied module map
suggests, then adds either or both headers. The end result is that
Clang-supplied headers get merged into the system-supplied module for
the C standard library.
As a drive-by, fix up a few dependencies in the _Builtin_instrinsics
module.
llvm-svn: 149611
Diffstat (limited to 'clang/test/Modules/Inputs')
4 files changed, 26 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/System/usr/include/module.map b/clang/test/Modules/Inputs/System/usr/include/module.map new file mode 100644 index 00000000000..884b59c80cd --- /dev/null +++ b/clang/test/Modules/Inputs/System/usr/include/module.map @@ -0,0 +1,21 @@ +module cstd [system] { + // Only in compiler support directory + module float_constants { + header "float.h" + } + + // Only in system headers directory + module stdio { + header "stdio.h" + } + + // In both directories (compiler support version wins, does not forward) + module stdbool { + header "stdbool.h" + } + + // In both directories (compiler support version wins, forwards) + module stdint { + header "stdint.h" + } +} diff --git a/clang/test/Modules/Inputs/System/usr/include/stdbool.h b/clang/test/Modules/Inputs/System/usr/include/stdbool.h new file mode 100644 index 00000000000..760d7dc48ef --- /dev/null +++ b/clang/test/Modules/Inputs/System/usr/include/stdbool.h @@ -0,0 +1 @@ +// Testing hack: does not define bool/true/false. diff --git a/clang/test/Modules/Inputs/System/usr/include/stdint.h b/clang/test/Modules/Inputs/System/usr/include/stdint.h new file mode 100644 index 00000000000..e8e50f90290 --- /dev/null +++ b/clang/test/Modules/Inputs/System/usr/include/stdint.h @@ -0,0 +1 @@ +typedef int my_awesome_nonstandard_integer_type; diff --git a/clang/test/Modules/Inputs/System/usr/include/stdio.h b/clang/test/Modules/Inputs/System/usr/include/stdio.h new file mode 100644 index 00000000000..9a7b1063032 --- /dev/null +++ b/clang/test/Modules/Inputs/System/usr/include/stdio.h @@ -0,0 +1,3 @@ +typedef struct { int id; } FILE; +int fprintf(FILE*restrict, const char* restrict format, ...); + |