diff options
| author | Chad Rosier <mcrosier@apple.com> | 2011-11-05 15:56:33 +0000 |
|---|---|---|
| committer | Chad Rosier <mcrosier@apple.com> | 2011-11-05 15:56:33 +0000 |
| commit | cda5732e52b4d9971e4c1525a8062080817f44da (patch) | |
| tree | 15304d9e2982ec70210a34ef8b5d732610a980ff /clang/lib/Driver | |
| parent | f7e0a31f8ae4e159921917cd5203d2595d17d33d (diff) | |
| download | bcm5719-llvm-cda5732e52b4d9971e4c1525a8062080817f44da.tar.gz bcm5719-llvm-cda5732e52b4d9971e4c1525a8062080817f44da.zip | |
[driver] If we're only linking, don't warn about unused arguments which are
obviously only used during compilation.
rdar://10386708
llvm-svn: 143813
Diffstat (limited to 'clang/lib/Driver')
| -rw-r--r-- | clang/lib/Driver/Driver.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 0a3d69880d7..6873add1982 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -1014,11 +1014,12 @@ void Driver::BuildActions(const ToolChain &TC, const DerivedArgList &Args, // Construct the actions to perform. ActionList LinkerInputs; + unsigned NumSteps = 0; for (unsigned i = 0, e = Inputs.size(); i != e; ++i) { types::ID InputType = Inputs[i].first; const Arg *InputArg = Inputs[i].second; - unsigned NumSteps = types::getNumCompilationPhases(InputType); + NumSteps = types::getNumCompilationPhases(InputType); assert(NumSteps && "Invalid number of steps!"); // If the first step comes after the final phase we are doing as part of @@ -1086,7 +1087,7 @@ void Driver::BuildActions(const ToolChain &TC, const DerivedArgList &Args, // If we are linking, claim any options which are obviously only used for // compilation. - if (FinalPhase == phases::Link) + if (FinalPhase == phases::Link && (NumSteps == 1)) Args.ClaimAllArgs(options::OPT_CompileOnly_Group); } |

