summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/InitHeaderSearch.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-02-02 18:42:48 +0000
committerDouglas Gregor <dgregor@apple.com>2012-02-02 18:42:48 +0000
commit3ec6663be0ed79325d9d865a31f514e2f4e218fe (patch)
tree0349663331af938bf06aa107523d24ff9f951ed5 /clang/lib/Frontend/InitHeaderSearch.cpp
parent248bc72737797c34d22f7d0fce34d87339b7c1ea (diff)
downloadbcm5719-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/lib/Frontend/InitHeaderSearch.cpp')
-rw-r--r--clang/lib/Frontend/InitHeaderSearch.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Frontend/InitHeaderSearch.cpp b/clang/lib/Frontend/InitHeaderSearch.cpp
index ee75e6921d9..9faa1267553 100644
--- a/clang/lib/Frontend/InitHeaderSearch.cpp
+++ b/clang/lib/Frontend/InitHeaderSearch.cpp
@@ -666,5 +666,13 @@ void clang::ApplyHeaderSearchOptions(HeaderSearch &HS,
Init.AddDefaultIncludePaths(Lang, Triple, HSOpts);
+ if (HSOpts.UseBuiltinIncludes) {
+ // Set up the builtin include directory in the module map.
+ llvm::sys::Path P(HSOpts.ResourceDir);
+ P.appendComponent("include");
+ if (const DirectoryEntry *Dir = HS.getFileMgr().getDirectory(P.str()))
+ HS.getModuleMap().setBuiltinIncludeDir(Dir);
+ }
+
Init.Realize(Lang);
}
OpenPOWER on IntegriCloud