diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-11-07 10:45:21 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-11-07 10:45:21 +0000 |
commit | 8d566cf11cc14832755d7112428b3bc6568b0c82 (patch) | |
tree | 62d32a081415031571e5e86008f5f767fd3cd397 | |
parent | b35250b253ed6366132a76b1863fe214f146489c (diff) | |
download | clang-8d566cf11cc14832755d7112428b3bc6568b0c82.tar.gz |
Merging r143917:
------------------------------------------------------------------------
r143917 | chandlerc | 2011-11-07 01:17:31 -0800 (Mon, 07 Nov 2011) | 12 lines
Rip out one of the features I added for the driver-include-management.
We don't actually need a separate flag for non-sysrooted paths as the
driver has to manage the sysroot anyways. The driver is not infrequently
adding paths to the header search based on their existence on the
filesystem. For that, it has to add the sysroot anyways, we should pass
it on down to CC1 already joined. More importantly, the driver cannot in
all cases distinguish between sysrooted paths and paths that are
relative to the Clang binary's installation directory. Essentially, we
always need to ignore the system root for these internal header search
options. It turns out in most of the places we were already providing
the system root in the driver, and then another one in CC1 so this fixes
several bugs.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_30@143956 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Driver/CC1Options.td | 6 | ||||
-rw-r--r-- | lib/Driver/ToolChains.cpp | 10 | ||||
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 11 | ||||
-rw-r--r-- | test/lit.cfg | 3 |
4 files changed, 6 insertions, 24 deletions
diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index f6ab842911..b9d835be8f 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -653,12 +653,6 @@ def internal_externc_isystem : JoinedOrSeparate<"-internal-externc-isystem">, "implicit extern \"C\" semantics; these are assumed to not be " "user-provided and are used to model system and standard headers' " "paths.">; -def internal_nosysroot_isystem : JoinedOrSeparate<"-internal-nosysroot-isystem">, - MetaVarName<"<directory>">, - HelpText<"Add directory to the internal system include search path without " - "applying a sysroot to it; these are assumed to not be " - "user-provided and are used to model system and standard headers' " - "paths.">; def iprefix : JoinedOrSeparate<"-iprefix">, MetaVarName<"<prefix>">, HelpText<"Set the -iwithprefix/-iwithprefixbefore prefix">; def iwithprefix : JoinedOrSeparate<"-iwithprefix">, MetaVarName<"<dir>">, diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index b140f9918e..ea604ccd07 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -1927,12 +1927,9 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs, addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/local/include"); if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) { - // Ignore the sysroot, we *always* look for clang headers relative to - // supplied path. llvm::sys::Path P(D.ResourceDir); P.appendComponent("include"); - CC1Args.push_back("-internal-nosysroot-isystem"); - CC1Args.push_back(DriverArgs.MakeArgString(P.str())); + addSystemInclude(DriverArgs, CC1Args, P.str()); } if (DriverArgs.hasArg(options::OPT_nostdlibinc)) @@ -2390,12 +2387,9 @@ void Windows::AddClangSystemIncludeArgs(const ArgList &DriverArgs, return; if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) { - // Ignore the sysroot, we *always* look for clang headers relative to - // supplied path. llvm::sys::Path P(getDriver().ResourceDir); P.appendComponent("include"); - CC1Args.push_back("-internal-nosysroot-isystem"); - CC1Args.push_back(DriverArgs.MakeArgString(P.str())); + addSystemInclude(DriverArgs, CC1Args, P.str()); } if (DriverArgs.hasArg(options::OPT_nostdlibinc)) diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 5b914aaac9..02b4ec04fd 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -571,9 +571,7 @@ static void HeaderSearchOptsToArgs(const HeaderSearchOptions &Opts, } else { if (E.IsInternal) { assert(E.Group == frontend::System && "Unexpected header search group"); - if (E.IgnoreSysRoot) - Res.push_back("-internal-nosysroot-isystem"); - else if (E.ImplicitExternC) + if (E.ImplicitExternC) Res.push_back("-internal-externc-isystem"); else Res.push_back("-internal-isystem"); @@ -1475,14 +1473,11 @@ 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_nosysroot_isystem), + OPT_internal_externc_isystem), E = Args.filtered_end(); I != E; ++I) Opts.AddPath((*I)->getValue(Args), frontend::System, - false, false, - (*I)->getOption().matches(OPT_internal_nosysroot_isystem), - /*IsInternal=*/true, + false, false, /*IgnoreSysRoot=*/true, /*IsInternal=*/true, (*I)->getOption().matches(OPT_internal_externc_isystem)); } diff --git a/test/lit.cfg b/test/lit.cfg index 2422ad0903..1f4a8452b0 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -157,8 +157,7 @@ def getClangBuiltinIncludeDir(clang): lit.fatal("Couldn't find the include dir for Clang ('%s')" % clang) return cmd.stdout.read().strip() -config.substitutions.append( ('%clang_cc1', - '%s -cc1 -internal-nosysroot-isystem %s' +config.substitutions.append( ('%clang_cc1', '%s -cc1 -internal-isystem %s' % (config.clang, getClangBuiltinIncludeDir(config.clang))) ) |