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

NAKAMURA Takumi geek4civic at gmail.com
Mon Mar 14 19:32:36 PDT 2011


Author: chapuni
Date: Mon Mar 14 21:32:36 2011
New Revision: 127652

URL: http://llvm.org/viewvc/llvm-project?rev=127652&view=rev
Log:
lib/Frontend/InitHeaderSearch.cpp: Introduce AddMinGW64CXXPaths(Base) for x86_64-w64-mingw32.

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=127652&r1=127651&r2=127652&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp (original)
+++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Mon Mar 14 21:32:36 2011
@@ -76,6 +76,10 @@
                                      llvm::StringRef Arch,
                                      llvm::StringRef Version);
 
+  /// AddMinGW64CXXPaths - Add the necessary paths to support
+  /// libstdc++ of x86_64-w64-mingw32 aka mingw-w64.
+  void AddMinGW64CXXPaths(llvm::StringRef Base);
+
   /// AddDelimitedPaths - Add a list of paths delimited by the system PATH
   /// separator. The processing follows that of the CPATH variable for gcc.
   void AddDelimitedPaths(llvm::StringRef String);
@@ -207,6 +211,15 @@
           CXXSystem, true, false, false);
 }
 
+void InitHeaderSearch::AddMinGW64CXXPaths(llvm::StringRef Base) {
+  AddPath(Base,
+          CXXSystem, true, false, false);
+  AddPath(Base + "/x86_64-w64-mingw32",
+          CXXSystem, true, false, false);
+  AddPath(Base + "/backward",
+          CXXSystem, true, false, false);
+}
+
   // FIXME: This probably should goto to some platform utils place.
 #ifdef _MSC_VER
 
@@ -534,6 +547,10 @@
     AddPath("/usr/include/w32api", System, true, false, false);
     break;
   case llvm::Triple::MinGW32:
+    // FIXME: We should be aware of i686-w64-mingw32.
+    if (triple.getArch() == llvm::Triple::x86_64)
+      AddPath("c:/mingw/x86_64-w64-mingw32/include",
+              System, true, false, false);
     AddPath("/mingw/include", System, true, false, false);
     AddPath("c:/mingw/include", System, true, false, false);
     break;
@@ -571,18 +588,13 @@
     AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", "i686-pc-cygwin", "3.4.4");
     break;
   case llvm::Triple::MinGW32:
-    // mingw-w64-20110207
-    AddPath("c:/MinGW/include/c++/4.5.3", CXXSystem, true, false, false);
-    AddPath("c:/MinGW/include/c++/4.5.3/x86_64-w64-mingw32", CXXSystem, true,
-            false, false);
-    AddPath("c:/MinGW/include/c++/4.5.3/backward", CXXSystem, true, false,
-            false);
-    // mingw-w64-20101129
-    AddPath("c:/MinGW/include/c++/4.5.2", CXXSystem, true, false, false);
-    AddPath("c:/MinGW/include/c++/4.5.2/x86_64-w64-mingw32", CXXSystem, true,
-            false, false);
-    AddPath("c:/MinGW/include/c++/4.5.2/backward", CXXSystem, true, false,
-            false);
+    // FIXME: We should be aware of i686-w64-mingw32.
+    if (triple.getArch() == llvm::Triple::x86_64) {
+      // mingw-w64-20110207
+      AddMinGW64CXXPaths("c:/mingw/x86_64-w64-mingw32/include/c++/4.5.3");
+      // mingw-w64-20101129
+      AddMinGW64CXXPaths("c:/mingw/x86_64-w64-mingw32/include/c++/4.5.2");
+    }
     // Try gcc 4.5.2 (MSYS)
     AddMinGWCPlusPlusIncludePaths("/mingw/lib/gcc", "mingw32", "4.5.2");
     // Try gcc 4.5.0





More information about the cfe-commits mailing list