diff options
author | Chad Rosier <mcrosier@apple.com> | 2011-10-04 01:53:36 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2011-10-04 01:53:36 +0000 |
commit | d0790b8a0687f5874bc46fc298133a8b070fb667 (patch) | |
tree | b1ad4f20e9b9ba0df4f672b249c0afafad00b2bf /lib/Driver/Tools.cpp | |
parent | 968b7a71c88bcd157f7d271517d7ceb266fed63a (diff) |
[driver] Improve r141053 by only emitting the warning if the original input
was assembly. Otherwise, something like -save-temps causes the integrated
assembler to warn.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141055 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 08d95f51e2..4762c65040 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -2318,10 +2318,20 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA, // Ignore explicit -force_cpusubtype_ALL option. (void) Args.hasArg(options::OPT_force__cpusubtype__ALL); + // Determine the original source input. + const Action *SourceAction = &JA; + while (SourceAction->getKind() != Action::InputClass) { + assert(!SourceAction->getInputs().empty() && "unexpected root action!"); + SourceAction = SourceAction->getInputs()[0]; + } + // FIXME: Add -g support, once we have it. For now, emit a warning indicating // the integrated assembler doesn't support debug info. - if (Args.hasArg(options::OPT_g_Group)) { - getToolChain().getDriver().Diag(diag::warn_drv_no_debug_w_integrated_as); + if (SourceAction->getType() == types::TY_Asm || + SourceAction->getType() == types::TY_PP_Asm) { + if (Args.hasArg(options::OPT_g_Group)) { + getToolChain().getDriver().Diag(diag::warn_drv_no_debug_w_integrated_as); + } } // FIXME: Add -static support, once we have it. |