From ca0e0545c216afaacba6da6c82a270dc2efc4e3f Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 24 Aug 2010 16:47:49 +0000 Subject: [PATCH] Driver/Clang: Forward -Wa, and -Xassembler to clang -cc1 when using the integrated assembler. For now this mostly just means that we will error out if someone tries to use this mechanism to send an argument to the assembler. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111921 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 0024bc94d8..4f839e9dea 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -708,6 +708,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, options::OPT_mno_relax_all, !IsOpt)) CmdArgs.push_back("-mrelax-all"); + + // When using an integrated assembler, we send -Wa, and -Xassembler options + // to -cc1. + Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA, + options::OPT_Xassembler); } else if (isa(JA)) { // Use PCH if the user requested it. bool UsePCH = D.CCCUsePCH; @@ -1322,7 +1327,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-fdiagnostics-show-category"); CmdArgs.push_back(A->getValue(Args)); } - + // Color diagnostics are the default, unless the terminal doesn't support // them. if (Args.hasFlag(options::OPT_fcolor_diagnostics, @@ -1337,7 +1342,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (!Args.hasFlag(options::OPT_fspell_checking, options::OPT_fno_spell_checking)) CmdArgs.push_back("-fno-spell-checking"); - + if (Arg *A = Args.getLastArg(options::OPT_fshow_overloads_EQ)) A->render(Args, CmdArgs); @@ -1426,7 +1431,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, for (ArgList::const_iterator it = Args.begin(), ie = Args.end(); it != ie; ++it) (*it)->render(Args, OriginalArgs); - + llvm::SmallString<256> Flags; Flags += Exec; for (unsigned i = 0, e = OriginalArgs.size(); i != e; ++i) { -- 2.50.1