diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-07-05 14:23:59 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-07-05 14:23:59 +0000 |
commit | c192b3dcffd5e672a2b2e1730e2440febb4fb192 (patch) | |
tree | ac719b5984165053bf83d71142e4d96b609b9784 /lib/Frontend/InitHeaderSearch.cpp | |
parent | 2e645aa5697838f16ec570eb07c2bee7e13d0e0b (diff) | |
download | src-c192b3dcffd5e672a2b2e1730e2440febb4fb192.tar.gz src-c192b3dcffd5e672a2b2e1730e2440febb4fb192.zip |
Notes
Diffstat (limited to 'lib/Frontend/InitHeaderSearch.cpp')
-rw-r--r-- | lib/Frontend/InitHeaderSearch.cpp | 65 |
1 files changed, 5 insertions, 60 deletions
diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp index bf8470ef1e78..e3a17c922fb8 100644 --- a/lib/Frontend/InitHeaderSearch.cpp +++ b/lib/Frontend/InitHeaderSearch.cpp @@ -82,11 +82,6 @@ public: StringRef Arch, StringRef Version); - /// AddMinGW64CXXPaths - Add the necessary paths to support - /// libstdc++ of x86_64-w64-mingw32 aka mingw-w64. - void AddMinGW64CXXPaths(StringRef Base, - StringRef Version); - // AddDefaultCIncludePaths - Add paths that should always be searched. void AddDefaultCIncludePaths(const llvm::Triple &triple, const HeaderSearchOptions &HSOpts); @@ -208,19 +203,6 @@ void InitHeaderSearch::AddMinGWCPlusPlusIncludePaths(StringRef Base, CXXSystem, false); } -void InitHeaderSearch::AddMinGW64CXXPaths(StringRef Base, - StringRef Version) { - // Assumes Base is HeaderSearchOpts' ResourceDir - AddPath(Base + "/../../../include/c++/" + Version, - CXXSystem, false); - AddPath(Base + "/../../../include/c++/" + Version + "/x86_64-w64-mingw32", - CXXSystem, false); - AddPath(Base + "/../../../include/c++/" + Version + "/i686-w64-mingw32", - CXXSystem, false); - AddPath(Base + "/../../../include/c++/" + Version + "/backward", - CXXSystem, false); -} - void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple, const HeaderSearchOptions &HSOpts) { llvm::Triple::OSType os = triple.getOS(); @@ -234,6 +216,9 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple, case llvm::Triple::Bitrig: case llvm::Triple::NaCl: break; + case llvm::Triple::Win32: + if (triple.getEnvironment() != llvm::Triple::Cygnus) + break; default: // FIXME: temporary hack: hard-coded paths. AddPath("/usr/local/include", System, false); @@ -323,26 +308,6 @@ void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple, AddPath("/usr/include/w32api", System, false); break; case llvm::Triple::GNU: - // mingw-w64 crt include paths - // <sysroot>/i686-w64-mingw32/include - SmallString<128> P = StringRef(HSOpts.ResourceDir); - llvm::sys::path::append(P, "../../../i686-w64-mingw32/include"); - AddPath(P, System, false); - - // <sysroot>/x86_64-w64-mingw32/include - P.resize(HSOpts.ResourceDir.size()); - llvm::sys::path::append(P, "../../../x86_64-w64-mingw32/include"); - AddPath(P, System, false); - - // mingw.org crt include paths - // <sysroot>/include - P.resize(HSOpts.ResourceDir.size()); - llvm::sys::path::append(P, "../../../include"); - AddPath(P, System, false); - AddPath("/mingw/include", System, false); -#if defined(LLVM_ON_WIN32) - AddPath("c:/mingw/include", System, false); -#endif break; } break; @@ -419,27 +384,8 @@ AddDefaultCPlusPlusIncludePaths(const llvm::Triple &triple, const HeaderSearchOp // g++-4 / Cygwin-1.5 AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", "i686-pc-cygwin", "4.3.2"); break; - case llvm::Triple::GNU: - // mingw-w64 C++ include paths (i686-w64-mingw32 and x86_64-w64-mingw32) - AddMinGW64CXXPaths(HSOpts.ResourceDir, "4.7.0"); - AddMinGW64CXXPaths(HSOpts.ResourceDir, "4.7.1"); - AddMinGW64CXXPaths(HSOpts.ResourceDir, "4.7.2"); - AddMinGW64CXXPaths(HSOpts.ResourceDir, "4.7.3"); - AddMinGW64CXXPaths(HSOpts.ResourceDir, "4.8.0"); - AddMinGW64CXXPaths(HSOpts.ResourceDir, "4.8.1"); - AddMinGW64CXXPaths(HSOpts.ResourceDir, "4.8.2"); - // mingw.org C++ include paths -#if defined(LLVM_ON_WIN32) - AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.7.0"); - AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.7.1"); - AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.7.2"); - AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.7.3"); - AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.8.0"); - AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.8.1"); - AddMinGWCPlusPlusIncludePaths("c:/MinGW/lib/gcc", "mingw32", "4.8.2"); -#endif - break; } + break; case llvm::Triple::DragonFly: if (llvm::sys::fs::exists("/usr/lib/gcc47")) AddPath("/usr/include/c++/4.7", CXXSystem, false); @@ -482,8 +428,7 @@ void InitHeaderSearch::AddDefaultIncludePaths(const LangOptions &Lang, return; case llvm::Triple::Win32: - if (triple.getEnvironment() == llvm::Triple::MSVC || - triple.getEnvironment() == llvm::Triple::Itanium || + if (triple.getEnvironment() != llvm::Triple::Cygnus || triple.isOSBinFormatMachO()) return; break; |