]> granicus.if.org Git - clang/commitdiff
[Frontend] Make the include dir group independent from the "use sysroot" bit.
authorDaniel Dunbar <daniel@zuster.org>
Tue, 29 Jan 2013 23:59:45 +0000 (23:59 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 29 Jan 2013 23:59:45 +0000 (23:59 +0000)
 - This slightly decouples the path handling, since before the group sometimes
   dominated the "use sysroot" bit, but it was still passed in via the API.

 - No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173855 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/CompilerInvocation.cpp
lib/Frontend/InitHeaderSearch.cpp

index 245de3416f5bfb9b0974628f723c92e056e8bcf8..b6a83b24d85c375c0e2788dc8feb2fdaf0e40ea0 100644 (file)
@@ -833,7 +833,7 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) {
       = IsIndexHeaderMap? frontend::IndexHeaderMap : frontend::Angled;
     
     Opts.AddPath((*it)->getValue(), Group,
-                 /*IsFramework=*/ (*it)->getOption().matches(OPT_F), false);
+                 /*IsFramework=*/ (*it)->getOption().matches(OPT_F), true);
     IsIndexHeaderMap = false;
   }
 
@@ -847,18 +847,18 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) {
       Prefix = A->getValue();
     else if (A->getOption().matches(OPT_iwithprefix))
       Opts.AddPath(Prefix.str() + A->getValue(),
-                   frontend::After, false, false);
+                   frontend::After, false, true);
     else
       Opts.AddPath(Prefix.str() + A->getValue(),
-                   frontend::Angled, false, false);
+                   frontend::Angled, false, true);
   }
 
   for (arg_iterator it = Args.filtered_begin(OPT_idirafter),
          ie = Args.filtered_end(); it != ie; ++it)
-    Opts.AddPath((*it)->getValue(), frontend::After, false, false);
+    Opts.AddPath((*it)->getValue(), frontend::After, false, true);
   for (arg_iterator it = Args.filtered_begin(OPT_iquote),
          ie = Args.filtered_end(); it != ie; ++it)
-    Opts.AddPath((*it)->getValue(), frontend::Quoted, false, false);
+    Opts.AddPath((*it)->getValue(), frontend::Quoted, false, true);
   for (arg_iterator it = Args.filtered_begin(OPT_isystem,
          OPT_iwithsysroot), ie = Args.filtered_end(); it != ie; ++it)
     Opts.AddPath((*it)->getValue(), frontend::System, false,
index d23c988e8278108a14045e57db6b8906358944d3..ba3abbaebc1deefae52f3b6a40ace3b25616f66b 100644 (file)
@@ -122,9 +122,7 @@ void InitHeaderSearch::AddPath(const Twine &Path,
   StringRef MappedPathStr = Path.toStringRef(MappedPathStorage);
 
   // Prepend the sysroot, if desired and this is a system header group.
-  if (HasSysroot && !IgnoreSysRoot &&
-      (Group == System || Group == CXXSystem) &&
-      CanPrefixSysroot(MappedPathStr)) {
+  if (HasSysroot && !IgnoreSysRoot && CanPrefixSysroot(MappedPathStr)) {
     MappedPathStorage.clear();
     MappedPathStr = (IncludeSysroot + Path).toStringRef(MappedPathStorage);
   }