diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-12-22 23:19:32 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-12-22 23:19:32 +0000 |
commit | c7a67b78773f64f12bc332882cb4220ea61ff778 (patch) | |
tree | 288f48a2e37096352f74481c146466ff52543f8f /clang/lib/Driver/Driver.cpp | |
parent | ad46e4416baffeb57f9bdba88375b8b98cb76aa4 (diff) | |
download | bcm5719-llvm-c7a67b78773f64f12bc332882cb4220ea61ff778.tar.gz bcm5719-llvm-c7a67b78773f64f12bc332882cb4220ea61ff778.zip |
Driver: When linking, don't warn about unused arguments which are obviously only
used during compilation.
- There is no easy way to define this group properly, unfortunately, and maybe
this is a losing strategy. For now this is unambiguous more friendly, though.
llvm-svn: 91940
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index dbe7bd9b682..c7eaad338c8 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -711,6 +711,11 @@ void Driver::BuildActions(const ArgList &Args, ActionList &Actions) const { // Add a link action if necessary. if (!LinkerInputs.empty()) Actions.push_back(new LinkJobAction(LinkerInputs, types::TY_Image)); + + // If we are linking, claim any options which are obviously only used for + // compilation. + if (FinalPhase == phases::Link) + Args.ClaimAllArgs(options::OPT_CompileOnly_Group); } Action *Driver::ConstructPhaseAction(const ArgList &Args, phases::ID Phase, |