[PATCH] D54426: [clang-cl] Do not allow using both /Zc:dllexportInlines- and /fallback flag

Phabricator via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 12 20:16:57 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rC346733: [clang-cl] Do not allow using both /Zc:dllexportInlines- and /fallback flag (authored by tikuta, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D54426?vs=173810&id=173811#toc

Repository:
  rC Clang

https://reviews.llvm.org/D54426

Files:
  include/clang/Basic/DiagnosticDriverKinds.td
  lib/Driver/ToolChains/Clang.cpp
  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
@@ -495,7 +495,7 @@
 // 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]
+// DllExportInlinesFallback: error: option '/Zc:dllexportInlines-' is ABI-changing and not compatible with '/fallback'
 
 // 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,12 +669,6 @@
   // 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: lib/Driver/ToolChains/Clang.cpp
===================================================================
--- lib/Driver/ToolChains/Clang.cpp
+++ lib/Driver/ToolChains/Clang.cpp
@@ -5502,8 +5502,13 @@
 
  if (Args.hasFlag(options::OPT__SLASH_Zc_dllexportInlines_,
                   options::OPT__SLASH_Zc_dllexportInlines,
-                  false))
+                  false)) {
+   if (Args.hasArg(options::OPT__SLASH_fallback)) {
+     D.Diag(clang::diag::err_drv_dllexport_inlines_and_fallback);
+   } else {
     CmdArgs.push_back("-fno-dllexport-inlines");
+   }
+ }
 
   Arg *MostGeneralArg = Args.getLastArg(options::OPT__SLASH_vmg);
   Arg *BestCaseArg = Args.getLastArg(options::OPT__SLASH_vmb);
Index: include/clang/Basic/DiagnosticDriverKinds.td
===================================================================
--- include/clang/Basic/DiagnosticDriverKinds.td
+++ include/clang/Basic/DiagnosticDriverKinds.td
@@ -161,9 +161,8 @@
   "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_dllexport_inlines_and_fallback : Error<
+  "option '/Zc:dllexportInlines-' is ABI-changing and not compatible with '/fallback'">;
 
 def err_drv_invalid_value : Error<"invalid value '%1' in '%0'">;
 def err_drv_invalid_int_value : Error<"invalid integral value '%1' in '%0'">;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54426.173811.patch
Type: text/x-patch
Size: 2902 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181113/4f257547/attachment.bin>


More information about the cfe-commits mailing list