[llvm-commits] [llvm] r49755 - /llvm/branches/ggreif/use-diet/include/llvm/Instructions.h

Gabor Greif ggreif at gmail.com
Tue Apr 15 16:44:12 PDT 2008


Author: ggreif
Date: Tue Apr 15 18:44:10 2008
New Revision: 49755

URL: http://llvm.org/viewvc/llvm-project?rev=49755&view=rev
Log:
poor SelectInst has been forgotten

Modified:
    llvm/branches/ggreif/use-diet/include/llvm/Instructions.h

Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Instructions.h?rev=49755&r1=49754&r2=49755&view=diff

==============================================================================
--- llvm/branches/ggreif/use-diet/include/llvm/Instructions.h (original)
+++ llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Tue Apr 15 18:44:10 2008
@@ -1121,8 +1121,8 @@
     : Instruction(SI.getType(), SI.getOpcode(), &Op<0>(), 3) {
     init(SI.Op<0>(), SI.Op<1>(), SI.Op<2>());
   }
-  SelectInst(Value *C, Value *S1, Value *S2, const std::string &Name = "",
-             Instruction *InsertBefore = 0)
+  SelectInst(Value *C, Value *S1, Value *S2, const std::string &Name,
+             Instruction *InsertBefore)
     : Instruction(S1->getType(), Instruction::Select, &Op<0>(), 3, InsertBefore) {
     init(C, S1, S2);
     setName(Name);
@@ -1135,11 +1135,11 @@
   }
 public:
   static SelectInst *Create(Value *C, Value *S1, Value *S2, const std::string &Name = "",
-             Instruction *InsertBefore = 0) {
+                            Instruction *InsertBefore = 0) {
     return new(3) SelectInst(C, S1, S2, Name, InsertBefore);
   }
-  static SelectInst *Create(Value *C, Value *S1, Value *S2, const std::string &Name,
-             BasicBlock *InsertAtEnd) {
+  static SelectInst *Create(Value *C, Value *S1, Value *S2, const std::string &Name = "",
+                            BasicBlock *InsertAtEnd) {
     return new(3) SelectInst(C, S1, S2, Name, InsertAtEnd);
   }
 
@@ -1148,15 +1148,7 @@
   Value *getFalseValue() const { return Op<2>(); }
 
   /// Transparently provide more efficient getOperand methods.
-  Value *getOperand(unsigned i) const {
-    assert(i < 3 && "getOperand() out of range!");
-    return OperandList[i];
-  }
-  void setOperand(unsigned i, Value *Val) {
-    assert(i < 3 && "setOperand() out of range!");
-    OperandList[i] = Val;
-  }
-  unsigned getNumOperands() const { return 3; }
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
 
   OtherOps getOpcode() const {
     return static_cast<OtherOps>(Instruction::getOpcode());
@@ -1174,6 +1166,12 @@
   }
 };
 
+template <>
+struct OperandTraits<SelectInst> : FixedNumOperandTraits<3> {
+};
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SelectInst, Value)
+
 //===----------------------------------------------------------------------===//
 //                                VAArgInst Class
 //===----------------------------------------------------------------------===//





More information about the llvm-commits mailing list