]> granicus.if.org Git - clang/commitdiff
[clang-cl] Add warning for /Zc:dllexportInlines- when the flag is used with /fallback
authorTakuto Ikuta <takuto.ikuta@gmail.com>
Fri, 9 Nov 2018 13:25:45 +0000 (13:25 +0000)
committerTakuto Ikuta <takuto.ikuta@gmail.com>
Fri, 9 Nov 2018 13:25:45 +0000 (13:25 +0000)
Summary:
This is followup of
https://reviews.llvm.org/D51340

Reviewers: hans, thakis

Reviewed By: hans

Subscribers: cfe-commits, llvm-commits

Differential Revision: https://reviews.llvm.org/D54298

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346491 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticDriverKinds.td
lib/Driver/ToolChains/MSVC.cpp
test/Driver/cl-options.c

index 44c9121f7b178aa5efb0a0b0e25d40e427ab6de8..357b739d4ce57f709ee3c1355182947e111960ee 100644 (file)
@@ -161,6 +161,10 @@ def warn_drv_yc_multiple_inputs_clang_cl : Warning<
   "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<
index 839f313623097ae10271a7fe2447c8585ad691b0..ac68db602f8cfc22649d6af7e68c6f4ff8b49c6b 100644 (file)
@@ -669,6 +669,12 @@ std::unique_ptr<Command> visualstudio::Compiler::GetCommand(
   // 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 aa97c1eb8885ab34b55f8234a535b2ab2e29ded2..12409431726bbe497de2bc897b11b99a41fdb8fc 100644 (file)
 // 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"