summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2011-10-04 01:53:36 +0000
committerChad Rosier <mcrosier@apple.com>2011-10-04 01:53:36 +0000
commit83200fdc65a8ded67f09bef09e93f20b189f66b2 (patch)
tree0e621ed368e39802ecea5035b7910cb69d6d79cc /clang/lib/Driver/Tools.cpp
parent1e31e53fe19c87b99480c36f7ca0c92ee7c4d696 (diff)
downloadbcm5719-llvm-83200fdc65a8ded67f09bef09e93f20b189f66b2.tar.gz
bcm5719-llvm-83200fdc65a8ded67f09bef09e93f20b189f66b2.zip
[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. llvm-svn: 141055
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r--clang/lib/Driver/Tools.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 08d95f51e20..4762c650409 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud