diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-12 16:59:50 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-12 16:59:50 +0000 |
commit | e6966fe563654422468e12db1abc3aad69fd78fd (patch) | |
tree | de7e3909a7c132b4b1677f0ef4c5a0cbcc72ebdd /lib | |
parent | 7de59a5b9e9c1cc8e2197171af2bc3f0c4fbcd22 (diff) |
Revert "Make clang-based tools find libc++ on MacOS"
This breaks the LLDB bots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346675 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Frontend/CreateInvocationFromCommandLine.cpp | 8 | ||||
-rw-r--r-- | lib/Frontend/InitHeaderSearch.cpp | 11 | ||||
-rw-r--r-- | lib/Tooling/Tooling.cpp | 3 |
3 files changed, 10 insertions, 12 deletions
diff --git a/lib/Frontend/CreateInvocationFromCommandLine.cpp b/lib/Frontend/CreateInvocationFromCommandLine.cpp index 3a5e1e8b15..2d4c40f8b9 100644 --- a/lib/Frontend/CreateInvocationFromCommandLine.cpp +++ b/lib/Frontend/CreateInvocationFromCommandLine.cpp @@ -11,18 +11,17 @@ // //===----------------------------------------------------------------------===// +#include "clang/Frontend/Utils.h" #include "clang/Basic/DiagnosticOptions.h" -#include "clang/Driver/Action.h" #include "clang/Driver/Compilation.h" #include "clang/Driver/Driver.h" +#include "clang/Driver/Action.h" #include "clang/Driver/Options.h" #include "clang/Driver/Tool.h" #include "clang/Frontend/CompilerInstance.h" #include "clang/Frontend/FrontendDiagnostic.h" -#include "clang/Frontend/Utils.h" #include "llvm/Option/ArgList.h" #include "llvm/Support/Host.h" -#include "llvm/Support/Path.h" using namespace clang; using namespace llvm::opt; @@ -103,8 +102,5 @@ std::unique_ptr<CompilerInvocation> clang::createInvocationFromCommandLine( CCArgs.size(), *Diags)) return nullptr; - // Patch up the install dir, so we find the same standard library as the - // original compiler on MacOS. - CI->getHeaderSearchOpts().InstallDir = TheDriver.getInstalledDir(); return CI; } diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp index 2f62ad3faf..deedb22f3e 100644 --- a/lib/Frontend/InitHeaderSearch.cpp +++ b/lib/Frontend/InitHeaderSearch.cpp @@ -476,9 +476,14 @@ void InitHeaderSearch::AddDefaultIncludePaths(const LangOptions &Lang, if (triple.isOSDarwin()) { // On Darwin, libc++ may be installed alongside the compiler in // include/c++/v1. - if (!HSOpts.InstallDir.empty()) { - // Get from foo/bin to foo. - SmallString<128> P(llvm::sys::path::parent_path(HSOpts.InstallDir)); + if (!HSOpts.ResourceDir.empty()) { + // Remove version from foo/lib/clang/version + StringRef NoVer = llvm::sys::path::parent_path(HSOpts.ResourceDir); + // Remove clang from foo/lib/clang + StringRef Lib = llvm::sys::path::parent_path(NoVer); + // Remove lib from foo/lib + SmallString<128> P = llvm::sys::path::parent_path(Lib); + // Get foo/include/c++/v1 llvm::sys::path::append(P, "include", "c++", "v1"); AddUnmappedPath(P, CXXSystem, false); diff --git a/lib/Tooling/Tooling.cpp b/lib/Tooling/Tooling.cpp index f113e47cdc..cfdb32f0ae 100644 --- a/lib/Tooling/Tooling.cpp +++ b/lib/Tooling/Tooling.cpp @@ -327,9 +327,6 @@ bool ToolInvocation::run() { Invocation->getPreprocessorOpts().addRemappedFile(It.getKey(), Input.release()); } - // Patch up the install dir, so we find the same standard library as the - // original compiler on MacOS. - Invocation->getHeaderSearchOpts().InstallDir = Driver->getInstalledDir(); return runInvocation(BinaryName, Compilation.get(), std::move(Invocation), std::move(PCHContainerOps)); } |