r193934 - Default to use libc++ on OS X 10.9+ and iOS 7+.
Bob Wilson
bob.wilson at apple.com
Sat Nov 2 16:19:54 PDT 2013
Author: bwilson
Date: Sat Nov 2 18:19:53 2013
New Revision: 193934
URL: http://llvm.org/viewvc/llvm-project?rev=193934&view=rev
Log:
Default to use libc++ on OS X 10.9+ and iOS 7+.
Modified:
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/test/PCH/cxx-typeid.cpp
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=193934&r1=193933&r2=193934&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Sat Nov 2 18:19:53 2013
@@ -839,6 +839,12 @@ DerivedArgList *Darwin::TranslateArgs(co
}
}
+ // Default to use libc++ on OS X 10.9+ and iOS 7+.
+ if (((isTargetMacOS() && !isMacosxVersionLT(10, 9)) ||
+ (isTargetIPhoneOS() && !isIPhoneOSVersionLT(7, 0))) &&
+ !Args.getLastArg(options::OPT_stdlib_EQ))
+ DAL->AddJoinedArg(0, Opts.getOption(options::OPT_stdlib_EQ), "libc++");
+
// Validate the C++ standard library choice.
CXXStdlibType Type = GetCXXStdlibType(*DAL);
if (Type == ToolChain::CST_Libcxx) {
Modified: cfe/trunk/test/PCH/cxx-typeid.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/PCH/cxx-typeid.cpp?rev=193934&r1=193933&r2=193934&view=diff
==============================================================================
--- cfe/trunk/test/PCH/cxx-typeid.cpp (original)
+++ cfe/trunk/test/PCH/cxx-typeid.cpp Sat Nov 2 18:19:53 2013
@@ -1,8 +1,8 @@
// Test this without pch.
-// RUN: %clang_cc1 -include %S/cxx-typeid.h -fsyntax-only -verify %s
+// RUN: %clang_cc1 -include %S/cxx-typeid.h -fsyntax-only -stdlib=libstdc++ -verify %s
-// RUN: %clang_cc1 -x c++-header -emit-pch -o %t.pch %S/cxx-typeid.h
-// RUN: %clang_cc1 -include-pch %t.pch -fsyntax-only -verify %s
+// RUN: %clang_cc1 -x c++-header -emit-pch -stdlib=libstdc++ -o %t.pch %S/cxx-typeid.h
+// RUN: %clang_cc1 -include-pch %t.pch -fsyntax-only -stdlib=libstdc++ -verify %s
// expected-no-diagnostics
More information about the cfe-commits
mailing list