summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-11-05 09:24:44 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-11-05 09:24:44 +0000
commitd9e10ecb688fe494c5dc3ee5a0fb977b26db28d9 (patch)
treed2053c2dd228f7be7efef1ada83f19e1886b22a2 /clang/lib/Frontend/CompilerInvocation.cpp
parent96ad7172267193c27596fbcc69167c86a0693299 (diff)
downloadbcm5719-llvm-d9e10ecb688fe494c5dc3ee5a0fb977b26db28d9.tar.gz
bcm5719-llvm-d9e10ecb688fe494c5dc3ee5a0fb977b26db28d9.zip
Fix a significant oversight in my move of MSVC includes to the driver:
actually manage the builtin header file includes as well as the system ones. This one is actually debatable whether it belongs in the driver or not, as the builtin includes are really an internal bit of implementation goop for Clang. However, they must be included at *exactly* the right point in the sequence of header files, which makes it essentially impossible to have this be managed by the Frontend and the rest by the Driver. I have terrible ideas that would "work", but I think they're worse than putting this in the driver and making the Frontend library even more ignorant of the environment and system on which it is being run. Also fix the fact that we weren't properly respecting the flags which suppress standard system include directories. Note that this still leaves all of the Clang tests which run CC1 directly and include builtin header files broken on Windows. I'm working on a followup patch to address that. llvm-svn: 143801
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 1829d7de0ad..1bcad24ee4d 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -577,8 +577,12 @@ static void HeaderSearchOptsToArgs(const HeaderSearchOptions &Opts,
} else {
if (E.IsInternal) {
assert(E.Group == frontend::System && "Unexpected header search group");
- Res.push_back(E.ImplicitExternC ? "-internal-externc-isystem"
- : "-internal-isystem");
+ if (E.IgnoreSysRoot)
+ Res.push_back("-internal-nosysroot-isystem");
+ else if (E.ImplicitExternC)
+ Res.push_back("-internal-externc-isystem");
+ else
+ Res.push_back("-internal-isystem");
} else {
if (E.Group != frontend::Angled && E.Group != frontend::System)
llvm::report_fatal_error("Invalid option set!");
@@ -1492,11 +1496,14 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) {
// Add the internal paths from a driver that detects standard include paths.
for (arg_iterator I = Args.filtered_begin(OPT_internal_isystem,
- OPT_internal_externc_isystem),
+ OPT_internal_externc_isystem,
+ OPT_internal_nosysroot_isystem),
E = Args.filtered_end();
I != E; ++I)
Opts.AddPath((*I)->getValue(Args), frontend::System,
- false, false, false, /*IsInternal=*/true,
+ false, false,
+ (*I)->getOption().matches(OPT_internal_nosysroot_isystem),
+ /*IsInternal=*/true,
(*I)->getOption().matches(OPT_internal_externc_isystem));
}
OpenPOWER on IntegriCloud