simplify logic and get rid of the assumption that operand 0 is the callee

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67642 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Gabor Greif 2009-03-24 19:28:39 +00:00
parent a0e6969bbe
commit f73e319751

View File

@ -123,14 +123,14 @@ bool AAEval::runOnFunction(Function &F) {
Pointers.insert(&*I);
Instruction &Inst = *I;
User::op_iterator OI = Inst.op_begin();
if ((isa<InvokeInst>(Inst) || isa<CallInst>(Inst)) &&
isa<Function>(Inst.getOperand(0)))
CallSite CS = CallSite::get(&Inst);
if (CS.getInstruction() &&
isa<Function>(CS.getCalledValue()))
++OI; // Skip actual functions for direct function calls.
for (; OI != Inst.op_end(); ++OI)
if (isa<PointerType>((*OI)->getType()) && !isa<ConstantPointerNull>(*OI))
Pointers.insert(*OI);
CallSite CS = CallSite::get(&*I);
if (CS.getInstruction()) CallSites.insert(CS);
}