]> granicus.if.org Git - clang/commitdiff
[Frontend] Rename a member variable to clarify its intent.
authorDaniel Dunbar <daniel@zuster.org>
Tue, 29 Jan 2013 23:59:43 +0000 (23:59 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 29 Jan 2013 23:59:43 +0000 (23:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173854 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/InitHeaderSearch.cpp

index f595fb1585f413aba682c9cddf625ddadc0f316b..d23c988e8278108a14045e57db6b8906358944d3 100644 (file)
@@ -43,13 +43,13 @@ class InitHeaderSearch {
   HeaderSearch &Headers;
   bool Verbose;
   std::string IncludeSysroot;
-  bool IsNotEmptyOrRoot;
+  bool HasSysroot;
 
 public:
 
   InitHeaderSearch(HeaderSearch &HS, bool verbose, StringRef sysroot)
     : Headers(HS), Verbose(verbose), IncludeSysroot(sysroot),
-      IsNotEmptyOrRoot(!(sysroot.empty() || sysroot == "/")) {
+      HasSysroot(!(sysroot.empty() || sysroot == "/")) {
   }
 
   /// AddPath - Add the specified path to the specified group list.
@@ -121,9 +121,10 @@ void InitHeaderSearch::AddPath(const Twine &Path,
   SmallString<256> MappedPathStorage;
   StringRef MappedPathStr = Path.toStringRef(MappedPathStorage);
 
-  // Handle isysroot.
-  if ((Group == System || Group == CXXSystem) && !IgnoreSysRoot &&
-      CanPrefixSysroot(MappedPathStr) && IsNotEmptyOrRoot) {
+  // Prepend the sysroot, if desired and this is a system header group.
+  if (HasSysroot && !IgnoreSysRoot &&
+      (Group == System || Group == CXXSystem) &&
+      CanPrefixSysroot(MappedPathStr)) {
     MappedPathStorage.clear();
     MappedPathStr = (IncludeSysroot + Path).toStringRef(MappedPathStorage);
   }