diff options
| author | Tim Northover <tnorthover@apple.com> | 2016-02-12 22:30:42 +0000 |
|---|---|---|
| committer | Tim Northover <tnorthover@apple.com> | 2016-02-12 22:30:42 +0000 |
| commit | b534ce46bd40eaa909a20f40ae576a2627da4f90 (patch) | |
| tree | 6d97cb6247054fa8723fd1c3e0a9395f67b11bea /clang/lib/Driver/ToolChains.cpp | |
| parent | df3857c7d44302f9525f3851b9855e20ca2436e6 (diff) | |
| download | bcm5719-llvm-b534ce46bd40eaa909a20f40ae576a2627da4f90.tar.gz bcm5719-llvm-b534ce46bd40eaa909a20f40ae576a2627da4f90.zip | |
Darwin: pass -stdlib=libc++ down to cc1 whenever we're targeting libc++
Recent refactoring meant it only got passed down when explicitly specified,
which breaks header search on Darwin.
llvm-svn: 260755
Diffstat (limited to 'clang/lib/Driver/ToolChains.cpp')
| -rw-r--r-- | clang/lib/Driver/ToolChains.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index a357863b8fa..6ce84daec11 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -1030,6 +1030,7 @@ DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args, const char *BoundArch) const { // First get the generic Apple args, before moving onto Darwin-specific ones. DerivedArgList *DAL = MachO::TranslateArgs(Args, BoundArch); + const OptTable &Opts = getDriver().getOpts(); // If no architecture is bound, none of the translations here are relevant. if (!BoundArch) @@ -1060,6 +1061,11 @@ DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args, } } + if (!Args.getLastArg(options::OPT_stdlib_EQ) && + GetDefaultCXXStdlibType() == ToolChain::CST_Libcxx) + DAL->AddJoinedArg(nullptr, Opts.getOption(options::OPT_stdlib_EQ), + "libc++"); + // Validate the C++ standard library choice. CXXStdlibType Type = GetCXXStdlibType(*DAL); if (Type == ToolChain::CST_Libcxx) { |

