aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2016-01-07 09:03:42 +0000
committerEric Christopher <echristo@gmail.com>2016-01-07 09:03:42 +0000
commit3f07d858261c9864ce57e7c413796bed940d4d77 (patch)
tree9edbfb632834e5117ea529d0733966f5f5c42cf3 /clang/lib/Driver/Tools.cpp
parentbd41cf880c9f3a65c9366565fa4db2ddb6b57e1c (diff)
downloadllvm-3f07d858261c9864ce57e7c413796bed940d4d77.zip
llvm-3f07d858261c9864ce57e7c413796bed940d4d77.tar.gz
llvm-3f07d858261c9864ce57e7c413796bed940d4d77.tar.bz2
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
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r--clang/lib/Driver/Tools.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 69a41d0..ec7db3d 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -6095,6 +6095,12 @@ void gcc::Common::ConstructJob(Compilation &C, const JobAction &JA,
for (const auto &A : Args) {
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.
if (isa<AssembleJobAction>(JA) &&
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))
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);
}
}