r193934 - Default to use libc++ on OS X 10.9+ and iOS 7+.

Nico Weber thakis at chromium.org
Sat Nov 2 19:05:26 PDT 2013


Thanks for upstreaming this!

Should this only happen in C++11 mode? libc++ seems to be measurably slower
than libstdc++ in C++03 mode (PR17703, PR14554, PR14555).


On Sat, Nov 2, 2013 at 4:19 PM, Bob Wilson <bob.wilson at apple.com> wrote:

> 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
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131102/82a9bad1/attachment.html>


More information about the cfe-commits mailing list