]> granicus.if.org Git - clang/commitdiff
Driver: Add -fallow-unsupported which disables some of the eager error'ing we do
authorDaniel Dunbar <daniel@zuster.org>
Fri, 24 Sep 2010 19:39:37 +0000 (19:39 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 24 Sep 2010 19:39:37 +0000 (19:39 +0000)
to prevent users from trying unsupported stuff. Useful for testing.

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

include/clang/Driver/Options.td
lib/Driver/Tools.cpp

index 6451e4ce72a896331d81ef64738d0693dd7484fd..95b84d3f708f42666fde722a916efc4f3014427c 100644 (file)
@@ -234,6 +234,7 @@ def fPIC : Flag<"-fPIC">, Group<f_Group>;
 def fPIE : Flag<"-fPIE">, Group<f_Group>;
 def fno_PIE : Flag<"-fno-PIE">, Group<f_Group>;
 def faccess_control : Flag<"-faccess-control">, Group<f_Group>;
+def fallow_unsupported : Flag<"-fallow-unsupported">, Group<f_Group>;
 def fapple_kext : Flag<"-fapple-kext">, Group<f_Group>;
 def fasm : Flag<"-fasm">, Group<f_Group>;
 def fasm_blocks : Flag<"-fasm-blocks">, Group<clang_ignored_f_Group>;
index b986f7f1c064e9bd690aa576499f2a87c5ade8d7..ff4af221e3dc0a181ebc5e79599bea6b468d765a 100644 (file)
@@ -988,19 +988,21 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
   // Explicitly error on some things we know we don't support and can't just
   // ignore.
   types::ID InputType = Inputs[0].getType();
-  Arg *Unsupported;
-  if ((Unsupported = Args.getLastArg(options::OPT_MG)) ||
-      (Unsupported = Args.getLastArg(options::OPT_iframework)) ||
-      (Unsupported = Args.getLastArg(options::OPT_fshort_enums)))
-    D.Diag(clang::diag::err_drv_clang_unsupported)
-      << Unsupported->getOption().getName();
-
-  if (types::isCXX(InputType) &&
-      getToolChain().getTriple().getOS() == llvm::Triple::Darwin &&
-      getToolChain().getTriple().getArch() == llvm::Triple::x86) {
-    if ((Unsupported = Args.getLastArg(options::OPT_fapple_kext)))
-      D.Diag(clang::diag::err_drv_clang_unsupported_opt_cxx_darwin_i386)
+  if (!Args.hasArg(options::OPT_fallow_unsupported)) {
+    Arg *Unsupported;
+    if ((Unsupported = Args.getLastArg(options::OPT_MG)) ||
+        (Unsupported = Args.getLastArg(options::OPT_iframework)) ||
+        (Unsupported = Args.getLastArg(options::OPT_fshort_enums)))
+      D.Diag(clang::diag::err_drv_clang_unsupported)
         << Unsupported->getOption().getName();
+
+    if (types::isCXX(InputType) &&
+        getToolChain().getTriple().getOS() == llvm::Triple::Darwin &&
+        getToolChain().getTriple().getArch() == llvm::Triple::x86) {
+      if ((Unsupported = Args.getLastArg(options::OPT_fapple_kext)))
+        D.Diag(clang::diag::err_drv_clang_unsupported_opt_cxx_darwin_i386)
+          << Unsupported->getOption().getName();
+    }
   }
 
   Args.AddAllArgs(CmdArgs, options::OPT_v);