From: Joerg Sonnenberger Date: Thu, 19 May 2011 18:42:29 +0000 (+0000) Subject: Support -fatal-warnings for the assembler frontend X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d793350dee89688f1cc939096dc60c3bc15c20fe;p=clang Support -fatal-warnings for the assembler frontend git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131662 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/CC1AsOptions.td b/include/clang/Driver/CC1AsOptions.td index 2643c4f0e8..cc418e7353 100644 --- a/include/clang/Driver/CC1AsOptions.td +++ b/include/clang/Driver/CC1AsOptions.td @@ -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">; diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 0086437052..c575afb95e 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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; diff --git a/tools/driver/cc1as_main.cpp b/tools/driver/cc1as_main.cpp index ec6ce65a9b..f449235db4 100644 --- a/tools/driver/cc1as_main.cpp +++ b/tools/driver/cc1as_main.cpp @@ -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);