[llvm-commits] [llvm] r142567 - /llvm/trunk/lib/Analysis/IPA/CallGraph.cpp

Eli Friedman eli.friedman at gmail.com
Wed Oct 19 20:23:14 PDT 2011


Author: efriedma
Date: Wed Oct 19 22:23:14 2011
New Revision: 142567

URL: http://llvm.org/viewvc/llvm-project?rev=142567&view=rev
Log:
Simplify; no intended functional change.


Modified:
    llvm/trunk/lib/Analysis/IPA/CallGraph.cpp

Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=142567&r1=142566&r2=142567&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original)
+++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Wed Oct 19 22:23:14 2011
@@ -127,16 +127,9 @@
       }
     }
 
-    // Loop over all of the users of the function, looking for non-call uses.
-    for (Value::use_iterator I = F->use_begin(), E = F->use_end(); I != E; ++I){
-      User *U = *I;
-      if ((!isa<CallInst>(U) && !isa<InvokeInst>(U))
-          || !CallSite(cast<Instruction>(U)).isCallee(I)) {
-        // Not a call, or being used as a parameter rather than as the callee.
-        ExternalCallingNode->addCalledFunction(CallSite(), Node);
-        break;
-      }
-    }
+    // If this function has its address taken, anything could call it.
+    if (F->hasAddressTaken())
+      ExternalCallingNode->addCalledFunction(CallSite(), Node);
 
     // If this function is not defined in this translation unit, it could call
     // anything.





More information about the llvm-commits mailing list