[cfe-commits] r133550 - in /cfe/trunk: include/clang/Frontend/HeaderSearchOptions.h lib/Frontend/CompilerInvocation.cpp lib/Frontend/InitHeaderSearch.cpp

Bob Wilson bob.wilson at apple.com
Tue Jun 21 14:53:08 PDT 2011


Author: bwilson
Date: Tue Jun 21 16:53:08 2011
New Revision: 133550

URL: http://llvm.org/viewvc/llvm-project?rev=133550&view=rev
Log:
Make InitHeaderSearch::AddPath and HeaderSearchOptions::AddPath consistent
use an "IgnoreSysRoot" argument.  HeaderSearchOptions had been using the
opposite form with "IsSysRootRelative", which made for much confusion when
looking at true/false values in calls in AddPath.  No functional change.

Modified:
    cfe/trunk/include/clang/Frontend/HeaderSearchOptions.h
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp
    cfe/trunk/lib/Frontend/InitHeaderSearch.cpp

Modified: cfe/trunk/include/clang/Frontend/HeaderSearchOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/HeaderSearchOptions.h?rev=133550&r1=133549&r2=133550&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/HeaderSearchOptions.h (original)
+++ cfe/trunk/include/clang/Frontend/HeaderSearchOptions.h Tue Jun 21 16:53:08 2011
@@ -39,15 +39,15 @@
     unsigned IsUserSupplied : 1;
     unsigned IsFramework : 1;
     
-    /// IsSysRootRelative - This is true if an absolute path should be treated
-    /// relative to the sysroot, or false if it should always be the absolute
+    /// IgnoreSysRoot - This is false if an absolute path should be treated
+    /// relative to the sysroot, or true if it should always be the absolute
     /// path.
-    unsigned IsSysRootRelative : 1;
+    unsigned IgnoreSysRoot : 1;
 
     Entry(llvm::StringRef path, frontend::IncludeDirGroup group,
-          bool isUserSupplied, bool isFramework, bool isSysRootRelative)
+          bool isUserSupplied, bool isFramework, bool ignoreSysRoot)
       : Path(path), Group(group), IsUserSupplied(isUserSupplied),
-        IsFramework(isFramework), IsSysRootRelative(isSysRootRelative) {}
+        IsFramework(isFramework), IgnoreSysRoot(ignoreSysRoot) {}
   };
 
   /// If non-empty, the directory to use as a "virtual system root" for include
@@ -96,9 +96,9 @@
 
   /// AddPath - Add the \arg Path path to the specified \arg Group list.
   void AddPath(llvm::StringRef Path, frontend::IncludeDirGroup Group,
-               bool IsUserSupplied, bool IsFramework, bool IsSysRootRelative) {
+               bool IsUserSupplied, bool IsFramework, bool IgnoreSysRoot) {
     UserEntries.push_back(Entry(Path, Group, IsUserSupplied, IsFramework,
-                                IsSysRootRelative));
+                                !IgnoreSysRoot));
   }
 };
 

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=133550&r1=133549&r2=133550&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Tue Jun 21 16:53:08 2011
@@ -1340,7 +1340,7 @@
   for (arg_iterator it = Args.filtered_begin(OPT_I, OPT_F),
          ie = Args.filtered_end(); it != ie; ++it)
     Opts.AddPath((*it)->getValue(Args), frontend::Angled, true,
-                 /*IsFramework=*/ (*it)->getOption().matches(OPT_F), true);
+                 /*IsFramework=*/ (*it)->getOption().matches(OPT_F), false);
 
   // Add -iprefix/-iwith-prefix/-iwithprefixbefore options.
   llvm::StringRef Prefix = ""; // FIXME: This isn't the correct default prefix.
@@ -1352,24 +1352,24 @@
       Prefix = A->getValue(Args);
     else if (A->getOption().matches(OPT_iwithprefix))
       Opts.AddPath(Prefix.str() + A->getValue(Args),
-                   frontend::System, false, false, true);
+                   frontend::System, false, false, false);
     else
       Opts.AddPath(Prefix.str() + A->getValue(Args),
-                   frontend::Angled, false, false, true);
+                   frontend::Angled, false, false, false);
   }
 
   for (arg_iterator it = Args.filtered_begin(OPT_idirafter),
          ie = Args.filtered_end(); it != ie; ++it)
-    Opts.AddPath((*it)->getValue(Args), frontend::After, true, false, true);
+    Opts.AddPath((*it)->getValue(Args), frontend::After, true, false, false);
   for (arg_iterator it = Args.filtered_begin(OPT_iquote),
          ie = Args.filtered_end(); it != ie; ++it)
-    Opts.AddPath((*it)->getValue(Args), frontend::Quoted, true, false, true);
+    Opts.AddPath((*it)->getValue(Args), frontend::Quoted, true, false, false);
   for (arg_iterator it = Args.filtered_begin(OPT_cxx_isystem, OPT_isystem,
          OPT_iwithsysroot), ie = Args.filtered_end(); it != ie; ++it)
     Opts.AddPath((*it)->getValue(Args),
                  ((*it)->getOption().matches(OPT_cxx_isystem) ?
                    frontend::CXXSystem : frontend::System),
-                 true, false, (*it)->getOption().matches(OPT_iwithsysroot));
+                 true, false, !(*it)->getOption().matches(OPT_iwithsysroot));
 
   // FIXME: Need options for the various environment variables!
 }

Modified: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=133550&r1=133549&r2=133550&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp (original)
+++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Tue Jun 21 16:53:08 2011
@@ -1094,7 +1094,7 @@
   for (unsigned i = 0, e = HSOpts.UserEntries.size(); i != e; ++i) {
     const HeaderSearchOptions::Entry &E = HSOpts.UserEntries[i];
     Init.AddPath(E.Path, E.Group, false, E.IsUserSupplied, E.IsFramework,
-                 !E.IsSysRootRelative);
+                 E.IgnoreSysRoot);
   }
 
   // Add entries from CPATH and friends.





More information about the cfe-commits mailing list