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

llvm-svn: 109222
This commit is contained in:
Gabor Greif 2010-07-23 10:23:01 +00:00
parent ea5f4cc47c
commit a04ffe0391

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;
}