summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/IPA/CallGraph.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-07-09 13:17:13 +0000
committerGabor Greif <ggreif@gmail.com>2010-07-09 13:17:13 +0000
commit1d20021d82638662fcad816ca442b8246f2e85df (patch)
tree2065cf08cb429128f607aab852e7887dcc2f4f4e /llvm/lib/Analysis/IPA/CallGraph.cpp
parent60a346d0f1da79d7f48c2870bd2f1a83bf643b60 (diff)
downloadbcm5719-llvm-1d20021d82638662fcad816ca442b8246f2e85df.tar.gz
bcm5719-llvm-1d20021d82638662fcad816ca442b8246f2e85df.zip
do not repeatedly dereference use_iterator
llvm-svn: 107963
Diffstat (limited to 'llvm/lib/Analysis/IPA/CallGraph.cpp')
-rw-r--r--llvm/lib/Analysis/IPA/CallGraph.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp
index 2bde56d7188..65c7c6efd80 100644
--- a/llvm/lib/Analysis/IPA/CallGraph.cpp
+++ b/llvm/lib/Analysis/IPA/CallGraph.cpp
@@ -126,13 +126,15 @@ 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)
- if ((!isa<CallInst>(I) && !isa<InvokeInst>(I))
- || !CallSite(cast<Instruction>(I)).isCallee(I)) {
+ 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 is not defined in this translation unit, it could call
// anything.
OpenPOWER on IntegriCloud