[PATCH] D133959: Add clang flag equivalent to clang-cl /Zl flag
Amy Huang via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 21 16:53:09 PDT 2022
akhuang updated this revision to Diff 462042.
akhuang marked an inline comment as done.
akhuang added a comment.
Change name of flag, and alias /Zl to this flag.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133959/new/
https://reviews.llvm.org/D133959
Files:
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/cl-runtime-flags.c
Index: clang/test/Driver/cl-runtime-flags.c
===================================================================
--- clang/test/Driver/cl-runtime-flags.c
+++ clang/test/Driver/cl-runtime-flags.c
@@ -97,6 +97,9 @@
// RUN: %clang_cl -### /Zl -- %s 2>&1 | FileCheck -check-prefix=CHECK-MTZl %s
// RUN: %clang_cl -### /MT /Zl -- %s 2>&1 | FileCheck -check-prefix=CHECK-MTZl %s
+// RUN: %clang -### --target=x86_64-windows-msvc -fms-runtime-lib=static \
+// RUN: -fms-omit-default-lib-name -- %s 2>&1 | FileCheck \
+// RUN: -check-prefix=CHECK-MTZl %s
// CHECK-MTZl-NOT: "-D_DEBUG"
// CHECK-MTZl: "-D_MT"
// CHECK-MTZl-NOT: "-D_DLL"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -4499,7 +4499,7 @@
llvm_unreachable("Unexpected option ID.");
}
- if (Args.hasArg(options::OPT__SLASH_Zl)) {
+ if (Args.hasArg(options::OPT_fms_omit_default_lib)) {
CmdArgs.push_back("-D_VC_NODEFAULTLIB");
} else {
CmdArgs.push_back(FlagForCRT.data());
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -2222,6 +2222,8 @@
to the cl flags /MT and /MTd which use the multithread, static version. "dll"
and "dll_dbg" correspond to the cl flags /MD and /MDd which use the multithread,
dll version.}]>;
+def fms_omit_default_lib : Joined<["-"], "fms-omit-default-lib">,
+ Group<f_Group>, Flags<[NoXarchOption, CoreOption]>;
defm delayed_template_parsing : BoolFOption<"delayed-template-parsing",
LangOpts<"DelayedTemplateParsing">, DefaultFalse,
PosFlag<SetTrue, [CC1Option], "Parse templated function definitions at the end of the translation unit">,
@@ -6779,7 +6781,7 @@
HelpText<"Volatile loads and stores have acquire and release semantics">;
def _SLASH_clang : CLJoined<"clang:">,
HelpText<"Pass <arg> to the clang driver">, MetaVarName<"<arg>">;
-def _SLASH_Zl : CLFlag<"Zl">,
+def _SLASH_Zl : CLFlag<"Zl">, Alias<fms_omit_default_lib>,
HelpText<"Do not let object file auto-link default libraries">;
def _SLASH_Yc : CLJoined<"Yc">,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133959.462042.patch
Type: text/x-patch
Size: 2272 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220921/6bfe373d/attachment.bin>
More information about the cfe-commits
mailing list