don't mark the arguments of prototype overdefined, they will never be queried.
authorChris Lattner <sabre@nondot.org>
Mon, 2 Nov 2009 06:34:04 +0000 (06:34 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 2 Nov 2009 06:34:04 +0000 (06:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85793 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/SCCP.cpp

index 553c94bebc50986d73b69087605fd2099112e5c1..c11380abf5e90fca4d2a86d9032af1c0f14c759f 100644 (file)
@@ -1646,16 +1646,19 @@ bool IPSCCP::runOnModule(Module &M) {
   // Loop over all functions, marking arguments to those with their addresses
   // taken or that are external as overdefined.
   //
-  for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F)
+  for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) {
+    if (F->isDeclaration())
+      continue;
+    
     if (!F->hasLocalLinkage() || AddressIsTaken(F)) {
-      if (!F->isDeclaration())
-        Solver.MarkBlockExecutable(F->begin());
+      Solver.MarkBlockExecutable(F->begin());
       for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end();
            AI != E; ++AI)
         Solver.markOverdefined(AI);
     } else {
       Solver.AddTrackedFunction(F);
     }
+  }
 
   // Loop over global variables.  We inform the solver about any internal global
   // variables that do not have their 'addresses taken'.  If they don't have