lib/Frontend/InitHeaderSearch.cpp: Introduce AddMinGW64CXXPaths(Base) for x86_64-w64-mingw32.

llvm-svn: 127652
This commit is contained in:
NAKAMURA Takumi 2011-03-15 02:32:36 +00:00
parent c4414c6e92
commit 63b4b456be
1 changed files with 24 additions and 12 deletions

View File

@ -76,6 +76,10 @@ public:
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 @@ void InitHeaderSearch::AddMinGWCPlusPlusIncludePaths(llvm::StringRef Base,
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 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
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 @@ AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple) {
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