[PATCH] D134468: [Driver] Drop MSVC<2015 tweaking
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 22 12:29:04 PDT 2022
MaskRay created this revision.
MaskRay added reviewers: aganea, hans, rnk, STL_MSFT, zequanwu.
Herald added a subscriber: StephenFan.
Herald added a project: All.
MaskRay requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
8db9176d688fd89a7578d120542fbfa7f87eb515 (2015) added -std=c++14
targeting MSVC>=2015.
D92515 <https://reviews.llvm.org/D92515>/D103293 <https://reviews.llvm.org/D103293> bumped MSVC required version. It's perhaps time to drop
tweaking for MSVC<2015 (-std=c++11 and -fno-threadsafe-statics).
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D134468
Files:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/cl-options.c
clang/test/Driver/cl-zc.cpp
Index: clang/test/Driver/cl-zc.cpp
===================================================================
--- clang/test/Driver/cl-zc.cpp
+++ clang/test/Driver/cl-zc.cpp
@@ -91,11 +91,6 @@
// RUN: %clang_cl /c -### /Zc:ternary- -- %s 2>&1 | FileCheck -check-prefix=TERNARY-OFF %s
// TERNARY-OFF: argument unused during compilation
-// thread safe statics are off for versions < 19.
-// RUN: %clang_cl /c -### -fms-compatibility-version=18 -- %s 2>&1 | FileCheck -check-prefix=NoThreadSafeStatics %s
-// RUN: %clang_cl /Zc:threadSafeInit /Zc:threadSafeInit- /c -### -- %s 2>&1 | FileCheck -check-prefix=NoThreadSafeStatics %s
-// NoThreadSafeStatics: "-fno-threadsafe-statics"
-
// RUN: %clang_cl /Zc:threadSafeInit /c -### -- %s 2>&1 | FileCheck -check-prefix=ThreadSafeStatics %s
// ThreadSafeStatics-NOT: "-fno-threadsafe-statics"
Index: clang/test/Driver/cl-options.c
===================================================================
--- clang/test/Driver/cl-options.c
+++ clang/test/Driver/cl-options.c
@@ -578,9 +578,6 @@
// Z7_gdwarf: "-debug-info-kind=constructor"
// Z7_gdwarf: "-dwarf-version=
-// RUN: %clang_cl -fmsc-version=1800 -TP -### -- %s 2>&1 | FileCheck -check-prefix=CXX11 %s
-// CXX11: -std=c++11
-
// RUN: %clang_cl -fmsc-version=1900 -TP -### -- %s 2>&1 | FileCheck -check-prefix=CXX14 %s
// CXX14: -std=c++14
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -6598,7 +6598,6 @@
CmdArgs.push_back(
Args.MakeArgString("-fms-compatibility-version=" + MSVT.getAsString()));
- bool IsMSVC2015Compatible = MSVT.getMajor() >= 19;
if (ImplyVCPPCVer) {
StringRef LanguageStandard;
if (const Arg *StdArg = Args.getLastArg(options::OPT__SLASH_std)) {
@@ -6628,12 +6627,8 @@
<< StdArg->getAsString(Args);
}
- if (LanguageStandard.empty()) {
- if (IsMSVC2015Compatible)
- LanguageStandard = "-std=c++14";
- else
- LanguageStandard = "-std=c++11";
- }
+ if (LanguageStandard.empty())
+ LanguageStandard = "-std=c++14";
CmdArgs.push_back(LanguageStandard.data());
}
@@ -6648,12 +6643,10 @@
else if (Args.hasArg(options::OPT_fno_declspec))
CmdArgs.push_back("-fno-declspec"); // Explicitly disabling __declspec.
- // -fthreadsafe-static is default, except for MSVC compatibility versions less
- // than 19.
+ // -fthreadsafe-static is default, except for OpenCL.
if (!Args.hasFlag(options::OPT_fthreadsafe_statics,
options::OPT_fno_threadsafe_statics,
- !types::isOpenCL(InputType) &&
- (!IsWindowsMSVC || IsMSVC2015Compatible)))
+ !types::isOpenCL(InputType)))
CmdArgs.push_back("-fno-threadsafe-statics");
// -fno-delayed-template-parsing is default, except when targeting MSVC.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134468.462266.patch
Type: text/x-patch
Size: 2960 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220922/abeee9df/attachment-0001.bin>
More information about the cfe-commits
mailing list