diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 75ae5c1ae42..e15430b0900 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -1405,25 +1405,12 @@ public: virtual ReturnInst *clone() const; - // Transparently provide more efficient getOperand methods. - Value *getOperand(unsigned i) const { - assert(i < getNumOperands() && "getOperand() out of range!"); - if (getNumOperands() == 0 || getNumOperands() == 1) + Value *getReturnValue(unsigned n = 0) const { + if (n == 0) return RetVal; - - return OperandList[i]; + return getOperand(n); } - void setOperand(unsigned i, Value *Val) { - assert(i < getNumOperands() && "setOperand() out of range!"); - if (i == 0) - RetVal = Val; - else - OperandList[i] = Val; - } - - Value *getReturnValue(unsigned n = 0) const; - unsigned getNumSuccessors() const { return 0; } // Methods for support type inquiry through isa, cast, and dyn_cast: diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index e0c14b83286..8a375048bf1 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -640,17 +640,6 @@ void ReturnInst::init(const Value * const* retVals, unsigned N) { } } -Value *ReturnInst::getReturnValue(unsigned n) const { - if (getNumOperands() == 0) - return 0; - - assert (n < getNumOperands() && "getReturnValue out of range!"); - if (getNumOperands() == 1) - return RetVal; - else - return OperandList[n]; -} - unsigned ReturnInst::getNumSuccessorsV() const { return getNumSuccessors(); }