akhuang updated this revision to Diff 462230. akhuang marked an inline comment as done. akhuang added a comment.
Fix flag name in test case 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 -- %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 @@ -2227,6 +2227,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">, @@ -6784,7 +6786,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">,
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 -- %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 @@ -2227,6 +2227,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">, @@ -6784,7 +6786,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">,
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits