mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
remove the private hack from CallInst, it was not supposed to hit the branch anyway
as a positive consequence the CallSite::getCallee() methods now can be rewritten to be a bit more efficient git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110380 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9850a28866
commit
3ecf355c7a
@ -941,28 +941,8 @@ public:
|
|||||||
unsigned(isTC));
|
unsigned(isTC));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @deprecated these "define hacks" will go away soon
|
|
||||||
/// @brief coerce out-of-tree code to abandon the low-level interfaces
|
|
||||||
/// @detail see below comments and update your code to high-level interfaces
|
|
||||||
/// - getOperand(0) ---> getCalledValue(), or possibly getCalledFunction
|
|
||||||
/// - setOperand(0, V) ---> setCalledFunction(V)
|
|
||||||
///
|
|
||||||
/// in LLVM v2.8-only code
|
|
||||||
/// - getOperand(N+1) ---> getArgOperand(N)
|
|
||||||
/// - setOperand(N+1, V) ---> setArgOperand(N, V)
|
|
||||||
/// - getNumOperands() ---> getNumArgOperands()+1 // note the "+1"!
|
|
||||||
///
|
|
||||||
/// in backward compatible code please consult llvm/Support/CallSite.h,
|
|
||||||
/// you should create a callsite using the CallInst pointer and call its
|
|
||||||
/// methods
|
|
||||||
///
|
|
||||||
# define public private
|
|
||||||
# define protected private
|
|
||||||
/// Provide fast operand accessors
|
/// Provide fast operand accessors
|
||||||
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
|
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
|
||||||
# undef public
|
|
||||||
# undef protected
|
|
||||||
public:
|
|
||||||
|
|
||||||
/// getNumArgOperands - Return the number of call arguments.
|
/// getNumArgOperands - Return the number of call arguments.
|
||||||
///
|
///
|
||||||
|
@ -261,13 +261,10 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
IterTy getCallee() const {
|
IterTy getCallee() const {
|
||||||
// FIXME: this is slow, since we do not have the fast versions
|
if (isCall()) // Skip Callee
|
||||||
// of the op_*() functions here. See CallSite::getCallee.
|
return cast<CallInst>(getInstruction())->op_end() - 1;
|
||||||
//
|
else // Skip BB, BB, Callee
|
||||||
if (isCall())
|
return cast<InvokeInst>(getInstruction())->op_end() - 3;
|
||||||
return getInstruction()->op_end() - 1; // Skip Callee
|
|
||||||
else
|
|
||||||
return getInstruction()->op_end() - 3; // Skip BB, BB, Callee
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ 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</*FIXME: CallInst*/User>(II)->op_end() - 1 // Skip Callee
|
? cast<CallInst>(II)->op_end() - 1 // Skip Callee
|
||||||
: cast<InvokeInst>(II)->op_end() - 3; // Skip BB, BB, Callee
|
: cast<InvokeInst>(II)->op_end() - 3; // Skip BB, BB, Callee
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user