Remove unnecessary getOperand/setOperand overriders.
authorDevang Patel <dpatel@apple.com>
Tue, 26 Feb 2008 19:08:13 +0000 (19:08 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 26 Feb 2008 19:08:13 +0000 (19:08 +0000)
Simplify getReturnValue()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47614 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Instructions.h
lib/VMCore/Instructions.cpp

index 75ae5c1ae42bb58353446939e3d987052ee4b517..e15430b090095d5e5e2ffc55fa7e876394c87db1 100644 (file)
@@ -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];
-  }
-
-  void setOperand(unsigned i, Value *Val) {
-    assert(i < getNumOperands() && "setOperand() out of range!");
-    if (i == 0) 
-      RetVal = Val;
-    else
-      OperandList[i] = Val;
+    return getOperand(n);
   }
 
-  Value *getReturnValue(unsigned n = 0) const;
-
   unsigned getNumSuccessors() const { return 0; }
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
index e0c14b832864000a36282dc31d95e2cb709bbeb7..8a375048bf1e5388c6b7c46498335fb81298dcc7 100644 (file)
@@ -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();
 }