Simplify; no intended functional change.
authorEli Friedman <eli.friedman@gmail.com>
Thu, 20 Oct 2011 03:23:14 +0000 (03:23 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Thu, 20 Oct 2011 03:23:14 +0000 (03:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142567 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/IPA/CallGraph.cpp

index 2e79eab51ff74430d08f6fe1e232fe04a5cbf596..0df3e8a38218e3f11af85973ed379b324156d040 100644 (file)
@@ -127,16 +127,9 @@ private:
       }
     }
 
-    // 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.