mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +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:
@@ -123,14 +123,14 @@ bool AAEval::runOnFunction(Function &F) {
|
|||||||
Pointers.insert(&*I);
|
Pointers.insert(&*I);
|
||||||
Instruction &Inst = *I;
|
Instruction &Inst = *I;
|
||||||
User::op_iterator OI = Inst.op_begin();
|
User::op_iterator OI = Inst.op_begin();
|
||||||
if ((isa<InvokeInst>(Inst) || isa<CallInst>(Inst)) &&
|
CallSite CS = CallSite::get(&Inst);
|
||||||
isa<Function>(Inst.getOperand(0)))
|
if (CS.getInstruction() &&
|
||||||
|
isa<Function>(CS.getCalledValue()))
|
||||||
++OI; // Skip actual functions for direct function calls.
|
++OI; // Skip actual functions for direct function calls.
|
||||||
for (; OI != Inst.op_end(); ++OI)
|
for (; OI != Inst.op_end(); ++OI)
|
||||||
if (isa<PointerType>((*OI)->getType()) && !isa<ConstantPointerNull>(*OI))
|
if (isa<PointerType>((*OI)->getType()) && !isa<ConstantPointerNull>(*OI))
|
||||||
Pointers.insert(*OI);
|
Pointers.insert(*OI);
|
||||||
|
|
||||||
CallSite CS = CallSite::get(&*I);
|
|
||||||
if (CS.getInstruction()) CallSites.insert(CS);
|
if (CS.getInstruction()) CallSites.insert(CS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user