[PATCH] D54298: [clang-cl] Add warning for /Zc:dllexportInlines- when the flag is used with /fallback
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 9 05:28:37 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rC346491: [clang-cl] Add warning for /Zc:dllexportInlines- when the flag is used with… (authored by tikuta, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D54298?vs=173302&id=173305#toc
Repository:
rC Clang
https://reviews.llvm.org/D54298
Files:
include/clang/Basic/DiagnosticDriverKinds.td
lib/Driver/ToolChains/MSVC.cpp
test/Driver/cl-options.c
Index: test/Driver/cl-options.c
===================================================================
--- test/Driver/cl-options.c
+++ test/Driver/cl-options.c
@@ -494,6 +494,8 @@
// NoDllExportInlines: "-fno-dllexport-inlines"
// RUN: %clang_cl /Zc:dllexportInlines /c -### -- %s 2>&1 | FileCheck -check-prefix=DllExportInlines %s
// DllExportInlines-NOT: "-fno-dllexport-inlines"
+// RUN: %clang_cl /fallback /Zc:dllexportInlines- /c -### -- %s 2>&1 | FileCheck -check-prefix=DllExportInlinesFallback %s
+// DllExportInlinesFallback: warning: option '/Zc:dllexportInlines-' is ignored when /fallback happens [-Woption-ignored]
// RUN: %clang_cl /Zi /c -### -- %s 2>&1 | FileCheck -check-prefix=Zi %s
// Zi: "-gcodeview"
Index: lib/Driver/ToolChains/MSVC.cpp
===================================================================
--- lib/Driver/ToolChains/MSVC.cpp
+++ lib/Driver/ToolChains/MSVC.cpp
@@ -669,6 +669,12 @@
// them too.
Args.AddAllArgs(CmdArgs, options::OPT_UNKNOWN);
+ // Warning for ignored flag.
+ if (const Arg *dllexportInlines =
+ Args.getLastArg(options::OPT__SLASH_Zc_dllexportInlines_))
+ C.getDriver().Diag(clang::diag::warn_drv_non_fallback_argument_clang_cl)
+ << dllexportInlines->getAsString(Args);
+
// Input filename.
assert(Inputs.size() == 1);
const InputInfo &II = Inputs[0];
Index: include/clang/Basic/DiagnosticDriverKinds.td
===================================================================
--- include/clang/Basic/DiagnosticDriverKinds.td
+++ include/clang/Basic/DiagnosticDriverKinds.td
@@ -161,6 +161,10 @@
"support for '/Yc' with more than one source file not implemented yet; flag ignored">,
InGroup<ClangClPch>;
+def warn_drv_non_fallback_argument_clang_cl : Warning<
+ "option '%0' is ignored when /fallback happens">,
+ InGroup<OptionIgnored>;
+
def err_drv_invalid_value : Error<"invalid value '%1' in '%0'">;
def err_drv_invalid_int_value : Error<"invalid integral value '%1' in '%0'">;
def err_drv_invalid_remap_file : Error<
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54298.173305.patch
Type: text/x-patch
Size: 2023 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181109/c27e472d/attachment.bin>
More information about the llvm-commits
mailing list