ldionne created this revision. ldionne added a reviewer: egorzhdan. Herald added a project: All. ldionne requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Flip the logic around: always default to libc++ except on older platforms, instead of defaulting to libstdc++ except on newer platforms. Since roughly all supported platforms use libc++ now, it makes more sense to make that the default, and allows the removal of some downstream diff. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D122232 Files: clang/lib/Driver/ToolChains/Darwin.cpp Index: clang/lib/Driver/ToolChains/Darwin.cpp =================================================================== --- clang/lib/Driver/ToolChains/Darwin.cpp +++ clang/lib/Driver/ToolChains/Darwin.cpp @@ -869,13 +869,13 @@ bool MachO::HasNativeLLVMSupport() const { return true; } ToolChain::CXXStdlibType Darwin::GetDefaultCXXStdlibType() const { - // Default to use libc++ on OS X 10.9+ and iOS 7+. - if ((isTargetMacOSBased() && !isMacosxVersionLT(10, 9)) || - (isTargetIOSBased() && !isIPhoneOSVersionLT(7, 0)) || - isTargetWatchOSBased()) - return ToolChain::CST_Libcxx; + // Use libstdc++ on old targets (OSX < 10.9 and iOS < 7) + if ((isTargetMacOSBased() && isMacosxVersionLT(10, 9)) || + (isTargetIOSBased() && isIPhoneOSVersionLT(7, 0))) + return ToolChain::CST_Libstdcxx; - return ToolChain::CST_Libstdcxx; + // On all other targets, use libc++ + return ToolChain::CST_Libcxx; } /// Darwin provides an ARC runtime starting in MacOS X 10.7 and iOS 5.0.
Index: clang/lib/Driver/ToolChains/Darwin.cpp =================================================================== --- clang/lib/Driver/ToolChains/Darwin.cpp +++ clang/lib/Driver/ToolChains/Darwin.cpp @@ -869,13 +869,13 @@ bool MachO::HasNativeLLVMSupport() const { return true; } ToolChain::CXXStdlibType Darwin::GetDefaultCXXStdlibType() const { - // Default to use libc++ on OS X 10.9+ and iOS 7+. - if ((isTargetMacOSBased() && !isMacosxVersionLT(10, 9)) || - (isTargetIOSBased() && !isIPhoneOSVersionLT(7, 0)) || - isTargetWatchOSBased()) - return ToolChain::CST_Libcxx; + // Use libstdc++ on old targets (OSX < 10.9 and iOS < 7) + if ((isTargetMacOSBased() && isMacosxVersionLT(10, 9)) || + (isTargetIOSBased() && isIPhoneOSVersionLT(7, 0))) + return ToolChain::CST_Libstdcxx; - return ToolChain::CST_Libstdcxx; + // On all other targets, use libc++ + return ToolChain::CST_Libcxx; } /// Darwin provides an ARC runtime starting in MacOS X 10.7 and iOS 5.0.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits