[cfe-commits] r143813 - /cfe/trunk/lib/Driver/Driver.cpp

Chad Rosier mcrosier at apple.com
Sat Nov 5 08:56:33 PDT 2011


Author: mcrosier
Date: Sat Nov  5 10:56:33 2011
New Revision: 143813

URL: http://llvm.org/viewvc/llvm-project?rev=143813&view=rev
Log:
[driver] If we're only linking, don't warn about unused arguments which are
obviously only used during compilation.
rdar://10386708

Modified:
    cfe/trunk/lib/Driver/Driver.cpp

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=143813&r1=143812&r2=143813&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Sat Nov  5 10:56:33 2011
@@ -1014,11 +1014,12 @@
 
   // 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 @@
 
   // 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);
 }
 





More information about the cfe-commits mailing list