]> granicus.if.org Git - clang/commitdiff
Support -fatal-warnings for the assembler frontend
authorJoerg Sonnenberger <joerg@bec.de>
Thu, 19 May 2011 18:42:29 +0000 (18:42 +0000)
committerJoerg Sonnenberger <joerg@bec.de>
Thu, 19 May 2011 18:42:29 +0000 (18:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131662 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/CC1AsOptions.td
lib/Driver/Tools.cpp
tools/driver/cc1as_main.cpp

index 2643c4f0e85435f42373638d346ca74fb9a8f4bd..cc418e7353fe1360203a3e371780755e58d789f5 100644 (file)
@@ -77,3 +77,6 @@ def relax_all : Flag<"-relax-all">,
 
 def no_exec_stack : Flag<"--noexecstack">,
     HelpText<"Mark the file as not needing an executable stack">;
+
+def fatal_warnings : Flag<"-fatal-warnings">,
+    HelpText<"Consider warnings as errors">;
index 008643705278ae9c682e0b1062eef15b98c86bbd..c575afb95eb6b301856e32d0c3c20b7ec0c9f219 100644 (file)
@@ -1020,6 +1020,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
           // Do nothing, this is the default and we don't support anything else.
         } else if (Value == "-L") {
           CmdArgs.push_back("-msave-temp-labels");
+        } else if (Value == "-fatal-warnings") {
+          CmdArgs.push_back("-mllvm");
+          CmdArgs.push_back("-fatal-assembler-warnings");
         } else {
           D.Diag(clang::diag::err_drv_unsupported_option_argument)
             << A->getOption().getName() << Value;
index ec6ce65a9b8b64c1c6d01eabe7d1cbcfd34857c8..f449235db4c4cdea385873db46c085852adc4f91 100644 (file)
@@ -172,6 +172,8 @@ void AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
     }
   }
   Opts.LLVMArgs = Args->getAllArgValues(OPT_mllvm);
+  if (Args->hasArg(OPT_fatal_warnings))
+    Opts.LLVMArgs.push_back("-fatal-assembler-warnings");
   Opts.OutputPath = Args->getLastArgValue(OPT_o);
   if (Arg *A = Args->getLastArg(OPT_filetype)) {
     StringRef Name = A->getValue(*Args);