aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-10-20 03:23:14 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-10-20 03:23:14 +0000
commit400ea5bde0a1154ba68ef7a0b1af6f0274cd6916 (patch)
tree8b6be6c3e9a4a72931560633d42777d03249d9f1
parent3a8eaa736f89a1462c2458828a42906cad17c560 (diff)
Simplify; no intended functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142567 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Analysis/IPA/CallGraph.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp
index 2e79eab51f..0df3e8a382 100644
--- a/lib/Analysis/IPA/CallGraph.cpp
+++ b/lib/Analysis/IPA/CallGraph.cpp
@@ -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.