do not (implicitly) dereference iterator many times, cache it instead

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109222 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Gabor Greif 2010-07-23 10:23:01 +00:00
parent 6252f6ea11
commit 9843688f97

View File

@ -171,8 +171,9 @@ void PIC16Overlay::MarkIndirectlyCalledFunctions(Module &M) {
for (Module::iterator MI = M.begin(), E = M.end(); MI != E; ++MI) {
for (Value::use_iterator I = MI->use_begin(), E = MI->use_end(); I != E;
++I) {
if ((!isa<CallInst>(I) && !isa<InvokeInst>(I))
|| !CallSite(cast<Instruction>(I)).isCallee(I)) {
User *U = *I;
if ((!isa<CallInst>(U) && !isa<InvokeInst>(U))
|| !CallSite(cast<Instruction>(U)).isCallee(I)) {
setColor(MI, ++IndirectCallColor);
break;
}