mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-26 23:32:58 +00:00
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:
parent
a0e6969bbe
commit
f73e319751
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user