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 | 5183b3d5d5f911f1e9fd8e5d877c7fe039963e31 (patch) | |
tree | 7d13fe7c00bfcdbf0ae57e9cda0f2e94f1f89bc8 | |
parent | 292da56eda73059279169cde9054efddffa75c27 (diff) |
[driver] If we're only linking, don't warn about unused arguments which are
obviously only used during compilation.
rdar://10386708
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143813 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Driver/Driver.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 0a3d69880d..6873add198 100644 --- a/lib/Driver/Driver.cpp +++ b/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); } |