From: Daniel Dunbar Date: Mon, 28 Mar 2011 22:49:28 +0000 (+0000) Subject: Integrated-As: Support -Wa,-L when using the integrated assembler. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=969323239f16589329d091a2b8ef200fcfe7c9e9;p=clang Integrated-As: Support -Wa,-L when using the integrated assembler. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128433 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index 6e1c61c99f..7c1a9f071e 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -160,7 +160,9 @@ def backend_option : Separate<"-backend-option">, def mregparm : Separate<"-mregparm">, HelpText<"Limit the number of registers available for integer arguments">; def mrelax_all : Flag<"-mrelax-all">, - HelpText<"Relax all machine instructions">; + HelpText<"(integrated-as) Relax all machine instructions">; +def msave_temp_labels : Flag<"-msave-temp-labels">, + HelpText<"(integrated-as) Save temporary labels">; def mrtd: Flag<"-mrtd">, HelpText<"Make StdCall calling convention the default">; def mrelocation_model : Separate<"-mrelocation-model">, diff --git a/include/clang/Frontend/CodeGenOptions.h b/include/clang/Frontend/CodeGenOptions.h index b49c431817..60a6398262 100644 --- a/include/clang/Frontend/CodeGenOptions.h +++ b/include/clang/Frontend/CodeGenOptions.h @@ -77,6 +77,7 @@ public: unsigned OptimizeSize : 1; /// If -Os is specified. unsigned RelaxAll : 1; /// Relax all machine code instructions. unsigned RelaxedAliasing : 1; /// Set when -fno-strict-aliasing is enabled. + unsigned SaveTempLabels : 1; /// Save temporary labels. unsigned SimplifyLibCalls : 1; /// Set when -fbuiltin is enabled. unsigned SoftFloat : 1; /// -soft-float. unsigned TimePasses : 1; /// Set when -ftime-report is enabled. @@ -154,6 +155,7 @@ public: OptimizeSize = 0; RelaxAll = 0; RelaxedAliasing = 0; + SaveTempLabels = 0; SimplifyLibCalls = 1; SoftFloat = 0; TimePasses = 0; diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index ce64dc7888..6358b9fc15 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -268,6 +268,8 @@ bool EmitAssemblyHelper::AddEmitPasses(BackendAction Action, if (CodeGenOpts.RelaxAll) TM->setMCRelaxAll(true); + if (CodeGenOpts.SaveTempLabels) + TM->setMCSaveTempLabels(true); // Create the code generator passes. PassManager *PM = getCodeGenPasses(); diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 721117071b..8ac68ed952 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -950,10 +950,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (Value == "-force_cpusubtype_ALL") { // Do nothing, this is the default and we don't support anything else. } else if (Value == "-L") { - // We don't support -L yet, but it isn't important enough to error - // on. No one should really be using it for a semantic change. - D.Diag(clang::diag::warn_drv_unsupported_option_argument) - << A->getOption().getName() << Value; + CmdArgs.push_back("-msave-temp-labels"); } else { D.Diag(clang::diag::err_drv_unsupported_option_argument) << A->getOption().getName() << Value; diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 4c7657e20d..4fc8b5bdf7 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -197,6 +197,8 @@ static void CodeGenOptsToArgs(const CodeGenOptions &Opts, } if (Opts.RelaxAll) Res.push_back("-mrelax-all"); + if (Opts.SaveTempLabels) + Res.push_back("-msave-temp-labels"); if (Opts.SoftFloat) Res.push_back("-msoft-float"); if (Opts.UnwindTables) @@ -935,6 +937,7 @@ static void ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.NumRegisterParameters = Args.getLastArgIntValue(OPT_mregparm, 0, Diags); Opts.RelaxAll = Args.hasArg(OPT_mrelax_all); Opts.OmitLeafFramePointer = Args.hasArg(OPT_momit_leaf_frame_pointer); + Opts.SaveTempLabels = Args.hasArg(OPT_msave_temp_labels); Opts.SoftFloat = Args.hasArg(OPT_msoft_float); Opts.UnsafeFPMath = Args.hasArg(OPT_cl_unsafe_math_optimizations) || Args.hasArg(OPT_cl_fast_relaxed_math);