[cfe-commits] r141055 - /cfe/trunk/lib/Driver/Tools.cpp
Chad Rosier
mcrosier at apple.com
Mon Oct 3 18:53:37 PDT 2011
Author: mcrosier
Date: Mon Oct 3 20:53:36 2011
New Revision: 141055
URL: http://llvm.org/viewvc/llvm-project?rev=141055&view=rev
Log:
[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.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=141055&r1=141054&r2=141055&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Oct 3 20:53:36 2011
@@ -2318,10 +2318,20 @@
// 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.
More information about the cfe-commits
mailing list