[cfe-commits] r116761 - in /cfe/trunk: include/clang/Basic/DiagnosticDriverKinds.td include/clang/Driver/Options.td lib/Driver/Tools.cpp

Daniel Dunbar daniel at zuster.org
Mon Oct 18 15:49:46 PDT 2010


Author: ddunbar
Date: Mon Oct 18 17:49:46 2010
New Revision: 116761

URL: http://llvm.org/viewvc/llvm-project?rev=116761&view=rev
Log:
Driver: Reject -fasm-blocks except on X86 (where we just ignore it, since
passing it is very prevalent in some circles).

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
    cfe/trunk/include/clang/Driver/Options.td
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td?rev=116761&r1=116760&r2=116761&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td Mon Oct 18 17:49:46 2010
@@ -53,6 +53,8 @@
   "'%0': unable to use AST files with this tool">;
 def err_drv_clang_unsupported : Error<
   "the clang compiler does not support '%0'">;
+def err_drv_clang_unsupported_per_platform : Error<
+  "the clang compiler does not support '%0' on this platform">;
 def err_drv_clang_unsupported_opt_cxx_darwin_i386 : Error<
   "the clang compiler does not support '%0' for C++ on Darwin/i386">;
 def err_drv_command_failed : Error<

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=116761&r1=116760&r2=116761&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Mon Oct 18 17:49:46 2010
@@ -237,7 +237,10 @@
 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>;
+
+def fasm_blocks : Flag<"-fasm-blocks">, Group<f_Group>;
+def fno_asm_blocks : Flag<"-fno-asm-blocks">, Group<f_Group>;
+
 def fassume_sane_operator_new : Flag<"-fassume-sane-operator-new">, Group<f_Group>;
 def fastcp : Flag<"-fastcp">, Group<f_Group>;
 def fastf : Flag<"-fastf">, Group<f_Group>;

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=116761&r1=116760&r2=116761&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Oct 18 17:49:46 2010
@@ -1469,6 +1469,18 @@
                     options::OPT_fno_spell_checking))
     CmdArgs.push_back("-fno-spell-checking");
 
+
+  // -fasm-blocks is disallowed except on X86, where we just ignore it.
+  if (Args.hasFlag(options::OPT_fasm_blocks, options::OPT_fno_asm_blocks,
+                   false)) {
+    if (getToolChain().getTriple().getArch() != llvm::Triple::x86 &&
+        getToolChain().getTriple().getArch() != llvm::Triple::x86_64)
+      D.Diag(clang::diag::err_drv_clang_unsupported_per_platform)
+        << "-fasm-blocks";
+  }
+
+  // -fasm-blocks is disallowed except on X86, where we just ignore it.
+
   if (Arg *A = Args.getLastArg(options::OPT_fshow_overloads_EQ))
     A->render(Args, CmdArgs);
 
@@ -1577,7 +1589,7 @@
     (*it)->claim();
     D.Diag(clang::diag::warn_drv_clang_unsupported) << (*it)->getAsString(Args);
   }
-
+  
   // Claim some arguments which clang supports automatically.
 
   // -fpch-preprocess is used with gcc to add a special marker in the output to





More information about the cfe-commits mailing list