diff options
author | Chris Lattner <sabre@nondot.org> | 2001-10-13 06:23:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-10-13 06:23:14 +0000 |
commit | 11a6d824472aa9502157d7df6f36180da02cebb7 (patch) | |
tree | a6140e60f7a812ef957dd70a37ea89dc002cd300 | |
parent | d97f8024536697d9e1347251e6373593decdd075 (diff) |
Add support for indirect calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@742 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/iOther.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/llvm/iOther.h b/include/llvm/iOther.h index 1351e71cea..52d75629e7 100644 --- a/include/llvm/iOther.h +++ b/include/llvm/iOther.h @@ -138,21 +138,24 @@ public: class CallInst : public Instruction { CallInst(const CallInst &CI); public: - CallInst(Method *M, const vector<Value*> ¶ms, const string &Name = ""); + CallInst(Value *Meth, const vector<Value*> ¶ms, const string &Name = ""); virtual const char *getOpcodeName() const { return "call"; } virtual Instruction *clone() const { return new CallInst(*this); } bool hasSideEffects() const { return true; } - const Method *getCalledMethod() const { - return cast<Method>(Operands[0]); + return dyn_cast<Method>(Operands[0]); } Method *getCalledMethod() { - return cast<Method>(Operands[0]); + return dyn_cast<Method>(Operands[0]); } + // getCalledValue - Get a pointer to a method that is invoked by this inst. + inline const Value *getCalledValue() const { return Operands[0]; } + inline Value *getCalledValue() { return Operands[0]; } + // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const CallInst *) { return true; } static inline bool classof(const Instruction *I) { |