diff options
-rw-r--r-- | include/llvm/Instructions.h | 20 | ||||
-rw-r--r-- | include/llvm/Support/CallSite.h | 11 | ||||
-rw-r--r-- | lib/VMCore/Instructions.cpp | 2 |
3 files changed, 5 insertions, 28 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index b4c88ca..f2854b6 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -941,28 +941,8 @@ public: 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 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); -# undef public -# undef protected -public: /// getNumArgOperands - Return the number of call arguments. /// diff --git a/include/llvm/Support/CallSite.h b/include/llvm/Support/CallSite.h index 5c6632b..9b6a409 100644 --- a/include/llvm/Support/CallSite.h +++ b/include/llvm/Support/CallSite.h @@ -261,13 +261,10 @@ private: } IterTy getCallee() const { - // FIXME: this is slow, since we do not have the fast versions - // of the op_*() functions here. See CallSite::getCallee. - // - if (isCall()) - return getInstruction()->op_end() - 1; // Skip Callee - else - return getInstruction()->op_end() - 3; // Skip BB, BB, Callee + if (isCall()) // Skip Callee + return cast<CallInst>(getInstruction())->op_end() - 1; + else // Skip BB, BB, Callee + return cast<InvokeInst>(getInstruction())->op_end() - 3; } }; diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index e03cc82..9e5fd23 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -33,7 +33,7 @@ using namespace llvm; User::op_iterator CallSite::getCallee() const { Instruction *II(getInstruction()); 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 } |