diff options
Diffstat (limited to 'clang/lib/Frontend/CreateInvocationFromCommandLine.cpp')
-rw-r--r-- | clang/lib/Frontend/CreateInvocationFromCommandLine.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp index 2d4c40f..3a5e1e8 100644 --- a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp +++ b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp @@ -11,17 +11,18 @@ // //===----------------------------------------------------------------------===// -#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; @@ -102,5 +103,8 @@ 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; } |