Darwin: fix stdlib handling when CLANG_DEFAULT_STDLIB is set
authorTim Northover <tnorthover@apple.com>
Mon, 15 Feb 2016 16:38:10 +0000 (16:38 +0000)
committerTim Northover <tnorthover@apple.com>
Mon, 15 Feb 2016 16:38:10 +0000 (16:38 +0000)
I'd accidentally skipped the CMake check in a premature optimisation. I'd also
put the original test in completely the wrong place.

Thanks Jonas Hahnfeld!

llvm-svn: 260898

clang/lib/Driver/ToolChains.cpp
clang/test/Driver/darwin-stdlib.cpp [moved from clang/darwin-stdlib.cpp with 100% similarity]

index ae24e47..6c5cdb2 100644 (file)
@@ -1060,7 +1060,7 @@ DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args,
   }
 
   if (!Args.getLastArg(options::OPT_stdlib_EQ) &&
-      GetDefaultCXXStdlibType() == ToolChain::CST_Libcxx)
+      GetCXXStdlibType(Args) == ToolChain::CST_Libcxx)
     DAL->AddJoinedArg(nullptr, Opts.getOption(options::OPT_stdlib_EQ),
                       "libc++");