mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-19 06:31:18 +00:00
reformulate CallSite::getCallee to adapt to CallInst::ArgOffset, and make it work even if CallInst::op_* are private
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107390 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c6f00e701e
commit
fa680ea1eb
@ -33,7 +33,9 @@ using namespace llvm;
|
|||||||
User::op_iterator CallSite::getCallee() const {
|
User::op_iterator CallSite::getCallee() const {
|
||||||
Instruction *II(getInstruction());
|
Instruction *II(getInstruction());
|
||||||
return isCall()
|
return isCall()
|
||||||
? cast<CallInst>(II)->op_begin()
|
? (CallInst::ArgOffset
|
||||||
|
? cast</*FIXME: CallInst*/User>(II)->op_begin()
|
||||||
|
: cast</*FIXME: CallInst*/User>(II)->op_end() - 1)
|
||||||
: cast<InvokeInst>(II)->op_end() - 3; // Skip BB, BB, Function
|
: cast<InvokeInst>(II)->op_end() - 3; // Skip BB, BB, Function
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user