summaryrefslogtreecommitdiff
path: root/lib/Analysis/IPA
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
commit517e124d53a673c35e34feec39304a1c6448d371 (patch)
tree03030bf4bd9a0a4b443f195cb77824e57b1ffebd /lib/Analysis/IPA
parentb654435712f3e1345cc40aff99724de9300e5de0 (diff)
downloadllvm-517e124d53a673c35e34feec39304a1c6448d371.tar.gz
llvm-517e124d53a673c35e34feec39304a1c6448d371.tar.bz2
llvm-517e124d53a673c35e34feec39304a1c6448d371.tar.xz
do not repeatedly dereference use_iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107963 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA')
-rw-r--r--lib/Analysis/IPA/CallGraph.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp
index 2bde56d718..65c7c6efd8 100644
--- a/lib/Analysis/IPA/CallGraph.cpp
+++ b/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.