[cfe-commits] r89661 - /cfe/trunk/lib/Frontend/InitHeaderSearch.cpp

Rafael Espindola rafael.espindola at gmail.com
Mon Nov 23 08:31:19 PST 2009


Author: rafael
Date: Mon Nov 23 10:31:19 2009
New Revision: 89661

URL: http://llvm.org/viewvc/llvm-project?rev=89661&view=rev
Log:
Reorder the header search a bit so that it matches gcc exactly:

*) the ../backward dir is the last in libstdc++ to be searched
*) If compiling c++, the c++ headers are searched first


Modified:
    cfe/trunk/lib/Frontend/InitHeaderSearch.cpp

Modified: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=89661&r1=89660&r2=89661&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp (original)
+++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Mon Nov 23 10:31:19 2009
@@ -170,9 +170,8 @@
                                                    const char *Dir32,
                                                    const char *Dir64,
                                                    const llvm::Triple &triple) {
-  // Add the common dirs
+  // Add the base dir
   AddPath(Base, System, true, false, false);
-  AddPath(Base + "/backward", System, true, false, false);
 
   // Add the multilib dirs
   llvm::Triple::ArchType arch = triple.getArch();
@@ -181,6 +180,9 @@
     AddPath(Base + "/" + ArchDir + "/" + Dir64, System, true, false, false);
   else
     AddPath(Base + "/" + ArchDir + "/" + Dir32, System, true, false, false);
+
+  // Add the backward dir
+  AddPath(Base + "/backward", System, true, false, false);
 }
 
 void InitHeaderSearch::AddMinGWCPlusPlusIncludePaths(const std::string &Base,
@@ -543,6 +545,9 @@
 
 void InitHeaderSearch::AddDefaultSystemIncludePaths(const LangOptions &Lang,
                                                     const llvm::Triple &triple) {
+  if (Lang.CPlusPlus)
+    AddDefaultCPlusPlusIncludePaths(triple);
+
   AddDefaultCIncludePaths(triple);
 
   // Add the default framework include paths on Darwin.
@@ -550,9 +555,6 @@
     AddPath("/System/Library/Frameworks", System, true, false, true);
     AddPath("/Library/Frameworks", System, true, false, true);
   }
-
-  if (Lang.CPlusPlus)
-    AddDefaultCPlusPlusIncludePaths(triple);
 }
 
 /// RemoveDuplicates - If there are duplicate directory entries in the specified





More information about the cfe-commits mailing list