[llvm-commits] [llvm] r47614 - in /llvm/trunk: include/llvm/Instructions.h lib/VMCore/Instructions.cpp

Devang Patel dpatel at apple.com
Tue Feb 26 11:08:13 PST 2008


Author: dpatel
Date: Tue Feb 26 13:08:13 2008
New Revision: 47614

URL: http://llvm.org/viewvc/llvm-project?rev=47614&view=rev
Log:

Remove unnecessary getOperand/setOperand overriders.
Simplify getReturnValue()

Modified:
    llvm/trunk/include/llvm/Instructions.h
    llvm/trunk/lib/VMCore/Instructions.cpp

Modified: llvm/trunk/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=47614&r1=47613&r2=47614&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Instructions.h (original)
+++ llvm/trunk/include/llvm/Instructions.h Tue Feb 26 13:08:13 2008
@@ -1405,25 +1405,12 @@
 
   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:

Modified: llvm/trunk/lib/VMCore/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=47614&r1=47613&r2=47614&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Instructions.cpp (original)
+++ llvm/trunk/lib/VMCore/Instructions.cpp Tue Feb 26 13:08:13 2008
@@ -640,17 +640,6 @@
   }
 }
 
-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();
 }





More information about the llvm-commits mailing list