forked from OSchip/llvm-project
Make sure we claim arguments that are going to be passed to a gcc tool,
even if they're not going to be used to avoid unused option warnings. llvm-svn: 257040
This commit is contained in:
parent
bd41cf880c
commit
3f07d85826
|
@ -6095,6 +6095,12 @@ void gcc::Common::ConstructJob(Compilation &C, const JobAction &JA,
|
||||||
|
|
||||||
for (const auto &A : Args) {
|
for (const auto &A : Args) {
|
||||||
if (forwardToGCC(A->getOption())) {
|
if (forwardToGCC(A->getOption())) {
|
||||||
|
// It is unfortunate that we have to claim here, as this means
|
||||||
|
// we will basically never report anything interesting for
|
||||||
|
// platforms using a generic gcc, even if we are just using gcc
|
||||||
|
// to get to the assembler.
|
||||||
|
A->claim();
|
||||||
|
|
||||||
// Don't forward any -g arguments to assembly steps.
|
// Don't forward any -g arguments to assembly steps.
|
||||||
if (isa<AssembleJobAction>(JA) &&
|
if (isa<AssembleJobAction>(JA) &&
|
||||||
A->getOption().matches(options::OPT_g_Group))
|
A->getOption().matches(options::OPT_g_Group))
|
||||||
|
@ -6105,11 +6111,6 @@ void gcc::Common::ConstructJob(Compilation &C, const JobAction &JA,
|
||||||
A->getOption().matches(options::OPT_W_Group))
|
A->getOption().matches(options::OPT_W_Group))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// It is unfortunate that we have to claim here, as this means
|
|
||||||
// we will basically never report anything interesting for
|
|
||||||
// platforms using a generic gcc, even if we are just using gcc
|
|
||||||
// to get to the assembler.
|
|
||||||
A->claim();
|
|
||||||
A->render(Args, CmdArgs);
|
A->render(Args, CmdArgs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,3 +13,9 @@
|
||||||
// CHECK-ASM: "-S"
|
// CHECK-ASM: "-S"
|
||||||
// CHECK-ASM: "-x" "f95"
|
// CHECK-ASM: "-x" "f95"
|
||||||
// CHECK-ASM-NOT: cc1
|
// CHECK-ASM-NOT: cc1
|
||||||
|
|
||||||
|
// RUN: %clang -Wall -target x86_64-unknown-linux-gnu -integrated-as %s -o %t -### 2>&1 | FileCheck --check-prefix=CHECK-WARN %s
|
||||||
|
// CHECK-WARN: gcc
|
||||||
|
// CHECK-WARN-NOT: "-Wall"
|
||||||
|
// CHECK-WARN: ld
|
||||||
|
// CHECK-WARN-NOT: "-Wall"
|
||||||
|
|
Loading…
Reference in New Issue