[llvm-commits] [llvm] r51570 - in /llvm/trunk: include/llvm/Instructions.h lib/Bitcode/Reader/BitcodeReader.cpp lib/Bitcode/Reader/BitcodeReader.h lib/VMCore/Constants.cpp lib/VMCore/Globals.cpp lib/VMCore/Instructions.cpp

Gabor Greif ggreif at gmail.com
Mon May 26 14:33:52 PDT 2008


Author: ggreif
Date: Mon May 26 16:33:52 2008
New Revision: 51570

URL: http://llvm.org/viewvc/llvm-project?rev=51570&view=rev
Log:
eliminate calls to deprecated Use::init() interface

Modified:
    llvm/trunk/include/llvm/Instructions.h
    llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
    llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h
    llvm/trunk/lib/VMCore/Constants.cpp
    llvm/trunk/lib/VMCore/Globals.cpp
    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=51570&r1=51569&r2=51570&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Instructions.h (original)
+++ llvm/trunk/include/llvm/Instructions.h Mon May 26 16:33:52 2008
@@ -291,8 +291,8 @@
   
   StoreInst(const StoreInst &SI) : Instruction(SI.getType(), Store,
                                                &Op<0>(), 2) {
-    Op<0>().init(SI.Op<0>(), this);
-    Op<1>().init(SI.Op<1>(), this);
+    Op<0>() = SI.Op<0>();
+    Op<1>() = SI.Op<1>();
     setVolatile(SI.isVolatile());
     setAlignment(SI.getAlignment());
     
@@ -1337,8 +1337,8 @@
 class ExtractElementInst : public Instruction {
   ExtractElementInst(const ExtractElementInst &EE) :
     Instruction(EE.getType(), ExtractElement, &Op<0>(), 2) {
-    Op<0>().init(EE.Op<0>(), this);
-    Op<1>().init(EE.Op<1>(), this);
+    Op<0>() = EE.Op<0>();
+    Op<1>() = EE.Op<1>();
   }
 
 public:
@@ -2010,8 +2010,8 @@
       resizeOperands(0);  // Get more space!
     // Initialize some new operands.
     NumOperands = OpNo+2;
-    OperandList[OpNo].init(V, this);
-    OperandList[OpNo+1].init(BB, this);
+    OperandList[OpNo] = V;
+    OperandList[OpNo+1] = BB;
   }
 
   /// removeIncomingValue - Remove an incoming value.  This is useful if a

Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=51570&r1=51569&r2=51570&view=diff

==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Mon May 26 16:33:52 2008
@@ -180,7 +180,7 @@
 
   // Create and return a placeholder, which will later be RAUW'd.
   Constant *C = new ConstantPlaceHolder(Ty);
-  OperandList[Idx].init(C, this);
+  OperandList[Idx] = C;
   return C;
 }
 
@@ -201,7 +201,7 @@
   
   // Create and return a placeholder, which will later be RAUW'd.
   Value *V = new Argument(Ty);
-  OperandList[Idx].init(V, this);
+  OperandList[Idx] = V;
   return V;
 }
 

Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h?rev=51570&r1=51569&r2=51570&view=diff

==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h Mon May 26 16:33:52 2008
@@ -89,7 +89,7 @@
       resize(Idx * 2 + 1);
     }
     assert(getOperand(Idx) == 0 && "Cannot init an already init'd Use!");
-    OperandList[Idx].init(V, this);
+    OperandList[Idx] = V;
   }
 };
 

Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=51570&r1=51569&r2=51570&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Mon May 26 16:33:52 2008
@@ -367,7 +367,7 @@
             (T->isAbstract() &&
              C->getType()->getTypeID() == T->getElementType()->getTypeID())) &&
            "Initializer for array element doesn't match array element type!");
-    OL->init(C, this);
+    *OL = C;
   }
 }
 
@@ -389,7 +389,7 @@
              T->getElementType(I-V.begin())->getTypeID() == 
                    C->getType()->getTypeID())) &&
            "Initializer for struct element doesn't match struct element type!");
-    OL->init(C, this);
+    *OL = C;
   }
 }
 
@@ -407,7 +407,7 @@
             (T->isAbstract() &&
              C->getType()->getTypeID() == T->getElementType()->getTypeID())) &&
            "Initializer for vector element doesn't match vector element type!");
-    OL->init(C, this);
+    *OL = C;
   }
 }
 
@@ -445,8 +445,8 @@
   }
   BinaryConstantExpr(unsigned Opcode, Constant *C1, Constant *C2)
     : ConstantExpr(C1->getType(), Opcode, &Op<0>(), 2) {
-    Op<0>().init(C1, this);
-    Op<1>().init(C2, this);
+    Op<0>() = C1;
+    Op<1>() = C2;
   }
   /// Transparently provide more efficient getOperand methods.
   DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
@@ -463,9 +463,9 @@
   }
   SelectConstantExpr(Constant *C1, Constant *C2, Constant *C3)
     : ConstantExpr(C2->getType(), Instruction::Select, &Op<0>(), 3) {
-    Op<0>().init(C1, this);
-    Op<1>().init(C2, this);
-    Op<2>().init(C3, this);
+    Op<0>() = C1;
+    Op<1>() = C2;
+    Op<2>() = C3;
   }
   /// Transparently provide more efficient getOperand methods.
   DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
@@ -484,8 +484,8 @@
   ExtractElementConstantExpr(Constant *C1, Constant *C2)
     : ConstantExpr(cast<VectorType>(C1->getType())->getElementType(), 
                    Instruction::ExtractElement, &Op<0>(), 2) {
-    Op<0>().init(C1, this);
-    Op<1>().init(C2, this);
+    Op<0>() = C1;
+    Op<1>() = C2;
   }
   /// Transparently provide more efficient getOperand methods.
   DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
@@ -504,9 +504,9 @@
   InsertElementConstantExpr(Constant *C1, Constant *C2, Constant *C3)
     : ConstantExpr(C1->getType(), Instruction::InsertElement, 
                    &Op<0>(), 3) {
-    Op<0>().init(C1, this);
-    Op<1>().init(C2, this);
-    Op<2>().init(C3, this);
+    Op<0>() = C1;
+    Op<1>() = C2;
+    Op<2>() = C3;
   }
   /// Transparently provide more efficient getOperand methods.
   DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
@@ -525,9 +525,9 @@
   ShuffleVectorConstantExpr(Constant *C1, Constant *C2, Constant *C3)
   : ConstantExpr(C1->getType(), Instruction::ShuffleVector, 
                  &Op<0>(), 3) {
-    Op<0>().init(C1, this);
-    Op<1>().init(C2, this);
-    Op<2>().init(C3, this);
+    Op<0>() = C1;
+    Op<1>() = C2;
+    Op<2>() = C3;
   }
   /// Transparently provide more efficient getOperand methods.
   DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
@@ -599,8 +599,8 @@
   CompareConstantExpr(const Type *ty, Instruction::OtherOps opc,
                       unsigned short pred,  Constant* LHS, Constant* RHS)
     : ConstantExpr(ty, opc, &Op<0>(), 2), predicate(pred) {
-    Op<0>().init(LHS, this);
-    Op<1>().init(RHS, this);
+    Op<0>() = LHS;
+    Op<1>() = RHS;
   }
   /// Transparently provide more efficient getOperand methods.
   DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
@@ -650,9 +650,9 @@
                    OperandTraits<ExtractValueConstantExpr>::op_end(this)
                    - (IdxList.size()+1),
                    IdxList.size()+1) {
-  OperandList[0].init(Agg, this);
+  OperandList[0] = Agg;
   for (unsigned i = 0, E = IdxList.size(); i != E; ++i)
-    OperandList[i+1].init(IdxList[i], this);
+    OperandList[i+1] = IdxList[i];
 }
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ExtractValueConstantExpr, Value)
@@ -669,10 +669,10 @@
                    OperandTraits<InsertValueConstantExpr>::op_end(this)
                    - (IdxList.size()+2),
                    IdxList.size()+2) {
-  OperandList[0].init(Agg, this);
-  OperandList[1].init(Val, this);
+  OperandList[0] = Agg;
+  OperandList[1] = Val;
   for (unsigned i = 0, E = IdxList.size(); i != E; ++i)
-    OperandList[i+2].init(IdxList[i], this);
+    OperandList[i+2] = IdxList[i];
 }
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(InsertValueConstantExpr, Value)
@@ -690,9 +690,9 @@
                    OperandTraits<GetElementPtrConstantExpr>::op_end(this)
                    - (IdxList.size()+1),
                    IdxList.size()+1) {
-  OperandList[0].init(C, this);
+  OperandList[0] = C;
   for (unsigned i = 0, E = IdxList.size(); i != E; ++i)
-    OperandList[i+1].init(IdxList[i], this);
+    OperandList[i+1] = IdxList[i];
 }
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(GetElementPtrConstantExpr, Value)

Modified: llvm/trunk/lib/VMCore/Globals.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Globals.cpp?rev=51570&r1=51569&r2=51570&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Globals.cpp (original)
+++ llvm/trunk/lib/VMCore/Globals.cpp Mon May 26 16:33:52 2008
@@ -104,7 +104,7 @@
   if (InitVal) {
     assert(InitVal->getType() == Ty &&
            "Initializer should be the same type as the GlobalVariable!");
-    Op<0>().init(InitVal, this);
+    Op<0>() = InitVal;
   }
 
   LeakDetector::addGarbageObject(this);
@@ -124,7 +124,7 @@
   if (InitVal) {
     assert(InitVal->getType() == Ty &&
            "Initializer should be the same type as the GlobalVariable!");
-    Op<0>().init(InitVal, this);
+    Op<0>() = InitVal;
   }
   
   LeakDetector::addGarbageObject(this);
@@ -191,7 +191,7 @@
 
   if (aliasee)
     assert(aliasee->getType() == Ty && "Alias and aliasee types should match!");
-  Op<0>().init(aliasee, this);
+  Op<0>() = aliasee;
 
   if (ParentModule)
     ParentModule->getAliasList().push_back(this);

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

==============================================================================
--- llvm/trunk/lib/VMCore/Instructions.cpp (original)
+++ llvm/trunk/lib/VMCore/Instructions.cpp Mon May 26 16:33:52 2008
@@ -118,8 +118,8 @@
     ReservedSpace(PN.getNumOperands()) {
   Use *OL = OperandList;
   for (unsigned i = 0, e = PN.getNumOperands(); i != e; i+=2) {
-    OL[i].init(PN.getOperand(i), this);
-    OL[i+1].init(PN.getOperand(i+1), this);
+    OL[i] = PN.getOperand(i);
+    OL[i+1] = PN.getOperand(i+1);
   }
 }
 
@@ -184,7 +184,7 @@
   Use *OldOps = OperandList;
   Use *NewOps = allocHungoffUses(NumOps);
   for (unsigned i = 0; i != e; ++i) {
-      NewOps[i].init(OldOps[i], this);
+      NewOps[i] = OldOps[i];
   }
   OperandList = NewOps;
   if (OldOps) Use::zap(OldOps, OldOps + e, true);
@@ -249,7 +249,7 @@
 void CallInst::init(Value *Func, Value* const *Params, unsigned NumParams) {
   assert(NumOperands == NumParams+1 && "NumOperands not set up?");
   Use *OL = OperandList;
-  OL[0].init(Func, this);
+  OL[0] = Func;
 
   const FunctionType *FTy =
     cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
@@ -262,16 +262,16 @@
     assert((i >= FTy->getNumParams() || 
             FTy->getParamType(i) == Params[i]->getType()) &&
            "Calling a function with a bad signature!");
-    OL[i+1].init(Params[i], this);
+    OL[i+1] = Params[i];
   }
 }
 
 void CallInst::init(Value *Func, Value *Actual1, Value *Actual2) {
   assert(NumOperands == 3 && "NumOperands not set up?");
   Use *OL = OperandList;
-  OL[0].init(Func, this);
-  OL[1].init(Actual1, this);
-  OL[2].init(Actual2, this);
+  OL[0] = Func;
+  OL[1] = Actual1;
+  OL[2] = Actual2;
 
   const FunctionType *FTy =
     cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
@@ -291,8 +291,8 @@
 void CallInst::init(Value *Func, Value *Actual) {
   assert(NumOperands == 2 && "NumOperands not set up?");
   Use *OL = OperandList;
-  OL[0].init(Func, this);
-  OL[1].init(Actual, this);
+  OL[0] = Func;
+  OL[1] = Actual;
 
   const FunctionType *FTy =
     cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
@@ -309,7 +309,7 @@
 void CallInst::init(Value *Func) {
   assert(NumOperands == 1 && "NumOperands not set up?");
   Use *OL = OperandList;
-  OL[0].init(Func, this);
+  OL[0] = Func;
 
   const FunctionType *FTy =
     cast<FunctionType>(cast<PointerType>(Func->getType())->getElementType());
@@ -370,7 +370,7 @@
   Use *OL = OperandList;
   Use *InOL = CI.OperandList;
   for (unsigned i = 0, e = CI.getNumOperands(); i != e; ++i)
-    OL[i].init(InOL[i], this);
+    OL[i] = InOL[i];
 }
 
 void CallInst::addParamAttr(unsigned i, ParameterAttributes attr) {
@@ -405,9 +405,9 @@
                       Value* const *Args, unsigned NumArgs) {
   assert(NumOperands == 3+NumArgs && "NumOperands not set up?");
   Use *OL = OperandList;
-  OL[0].init(Fn, this);
-  OL[1].init(IfNormal, this);
-  OL[2].init(IfException, this);
+  OL[0] = Fn;
+  OL[1] = IfNormal;
+  OL[2] = IfException;
   const FunctionType *FTy =
     cast<FunctionType>(cast<PointerType>(Fn->getType())->getElementType());
   FTy = FTy;  // silence warning.
@@ -421,7 +421,7 @@
             FTy->getParamType(i) == Args[i]->getType()) &&
            "Invoking a function with a bad signature!");
     
-    OL[i+3].init(Args[i], this);
+    OL[i+3] = Args[i];
   }
 }
 
@@ -434,7 +434,7 @@
   SubclassData = II.SubclassData;
   Use *OL = OperandList, *InOL = II.OperandList;
   for (unsigned i = 0, e = II.getNumOperands(); i != e; ++i)
-    OL[i].init(InOL[i], this);
+    OL[i] = InOL[i];
 }
 
 BasicBlock *InvokeInst::getSuccessorV(unsigned idx) const {
@@ -482,11 +482,11 @@
                    RI.getNumOperands()) {
   unsigned N = RI.getNumOperands();
   if (N == 1)
-    Op<0>().init(RI.Op<0>(), this);
+    Op<0>() = RI.Op<0>();
   else if (N) {
     Use *OL = OperandList;
     for (unsigned i = 0; i < N; ++i)
-      OL[i].init(RI.getOperand(i), this);
+      OL[i] = RI.getOperand(i);
   }
 }
 
@@ -535,7 +535,7 @@
     Value *V = *retVals;
     if (V->getType() == Type::VoidTy)
       return;
-    Op<0>().init(V, this);
+    Op<0>() = V;
     return;
   }
 
@@ -544,7 +544,7 @@
     Value *V = *retVals++;
     assert(!isa<BasicBlock>(V) &&
            "Cannot return basic block.  Probably using the incorrect ctor");
-    OL[i].init(V, this);
+    OL[i] = V;
   }
 }
 
@@ -633,16 +633,16 @@
                    OperandTraits<BranchInst>::op_end(this) - 1,
                    1, InsertBefore) {
   assert(IfTrue != 0 && "Branch destination may not be null!");
-  Op<0>().init(reinterpret_cast<Value*>(IfTrue), this);
+  Op<0>() = reinterpret_cast<Value*>(IfTrue);
 }
 BranchInst::BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
                        Instruction *InsertBefore)
   : TerminatorInst(Type::VoidTy, Instruction::Br,
                    OperandTraits<BranchInst>::op_end(this) - 3,
                    3, InsertBefore) {
-  Op<0>().init(reinterpret_cast<Value*>(IfTrue), this);
-  Op<1>().init(reinterpret_cast<Value*>(IfFalse), this);
-  Op<2>().init(Cond, this);
+  Op<0>() = reinterpret_cast<Value*>(IfTrue);
+  Op<1>() = reinterpret_cast<Value*>(IfFalse);
+  Op<2>() = Cond;
 #ifndef NDEBUG
   AssertOK();
 #endif
@@ -653,7 +653,7 @@
                    OperandTraits<BranchInst>::op_end(this) - 1,
                    1, InsertAtEnd) {
   assert(IfTrue != 0 && "Branch destination may not be null!");
-  Op<0>().init(reinterpret_cast<Value*>(IfTrue), this);
+  Op<0>() = reinterpret_cast<Value*>(IfTrue);
 }
 
 BranchInst::BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
@@ -661,9 +661,9 @@
   : TerminatorInst(Type::VoidTy, Instruction::Br,
                    OperandTraits<BranchInst>::op_end(this) - 3,
                    3, InsertAtEnd) {
-  Op<0>().init(reinterpret_cast<Value*>(IfTrue), this);
-  Op<1>().init(reinterpret_cast<Value*>(IfFalse), this);
-  Op<2>().init(Cond, this);
+  Op<0>() = reinterpret_cast<Value*>(IfTrue);
+  Op<1>() = reinterpret_cast<Value*>(IfFalse);
+  Op<2>() = Cond;
 #ifndef NDEBUG
   AssertOK();
 #endif
@@ -674,11 +674,11 @@
   TerminatorInst(Type::VoidTy, Instruction::Br,
                  OperandTraits<BranchInst>::op_end(this) - BI.getNumOperands(),
                  BI.getNumOperands()) {
-  OperandList[0].init(BI.getOperand(0), this);
+  OperandList[0] = BI.getOperand(0);
   if (BI.getNumOperands() != 1) {
     assert(BI.getNumOperands() == 3 && "BR can have 1 or 3 operands!");
-    OperandList[1].init(BI.getOperand(1), this);
-    OperandList[2].init(BI.getOperand(2), this);
+    OperandList[1] = BI.getOperand(1);
+    OperandList[2] = BI.getOperand(2);
   }
 }
 
@@ -909,8 +909,8 @@
                 OperandTraits<StoreInst>::op_begin(this),
                 OperandTraits<StoreInst>::operands(this),
                 InsertBefore) {
-  Op<0>().init(val, this);
-  Op<1>().init(addr, this);
+  Op<0>() = val;
+  Op<1>() = addr;
   setVolatile(false);
   setAlignment(0);
   AssertOK();
@@ -921,8 +921,8 @@
                 OperandTraits<StoreInst>::op_begin(this),
                 OperandTraits<StoreInst>::operands(this),
                 InsertAtEnd) {
-  Op<0>().init(val, this);
-  Op<1>().init(addr, this);
+  Op<0>() = val;
+  Op<1>() = addr;
   setVolatile(false);
   setAlignment(0);
   AssertOK();
@@ -934,8 +934,8 @@
                 OperandTraits<StoreInst>::op_begin(this),
                 OperandTraits<StoreInst>::operands(this),
                 InsertBefore) {
-  Op<0>().init(val, this);
-  Op<1>().init(addr, this);
+  Op<0>() = val;
+  Op<1>() = addr;
   setVolatile(isVolatile);
   setAlignment(0);
   AssertOK();
@@ -947,8 +947,8 @@
                 OperandTraits<StoreInst>::op_begin(this),
                 OperandTraits<StoreInst>::operands(this),
                 InsertBefore) {
-  Op<0>().init(val, this);
-  Op<1>().init(addr, this);
+  Op<0>() = val;
+  Op<1>() = addr;
   setVolatile(isVolatile);
   setAlignment(Align);
   AssertOK();
@@ -960,8 +960,8 @@
                 OperandTraits<StoreInst>::op_begin(this),
                 OperandTraits<StoreInst>::operands(this),
                 InsertAtEnd) {
-  Op<0>().init(val, this);
-  Op<1>().init(addr, this);
+  Op<0>() = val;
+  Op<1>() = addr;
   setVolatile(isVolatile);
   setAlignment(Align);
   AssertOK();
@@ -973,8 +973,8 @@
                 OperandTraits<StoreInst>::op_begin(this),
                 OperandTraits<StoreInst>::operands(this),
                 InsertAtEnd) {
-  Op<0>().init(val, this);
-  Op<1>().init(addr, this);
+  Op<0>() = val;
+  Op<1>() = addr;
   setVolatile(isVolatile);
   setAlignment(0);
   AssertOK();
@@ -996,17 +996,17 @@
 void GetElementPtrInst::init(Value *Ptr, Value* const *Idx, unsigned NumIdx) {
   assert(NumOperands == 1+NumIdx && "NumOperands not initialized?");
   Use *OL = OperandList;
-  OL[0].init(Ptr, this);
+  OL[0] = Ptr;
 
   for (unsigned i = 0; i != NumIdx; ++i)
-    OL[i+1].init(Idx[i], this);
+    OL[i+1] = Idx[i];
 }
 
 void GetElementPtrInst::init(Value *Ptr, Value *Idx) {
   assert(NumOperands == 2 && "NumOperands not initialized?");
   Use *OL = OperandList;
-  OL[0].init(Ptr, this);
-  OL[1].init(Idx, this);
+  OL[0] = Ptr;
+  OL[1] = Idx;
 }
 
 GetElementPtrInst::GetElementPtrInst(const GetElementPtrInst &GEPI)
@@ -1017,7 +1017,7 @@
   Use *OL = OperandList;
   Use *GEPIOL = GEPI.OperandList;
   for (unsigned i = 0, E = NumOperands; i != E; ++i)
-    OL[i].init(GEPIOL[i], this);
+    OL[i] = GEPIOL[i];
 }
 
 GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value *Idx,
@@ -1112,8 +1112,8 @@
                 2, InsertBef) {
   assert(isValidOperands(Val, Index) &&
          "Invalid extractelement instruction operands!");
-  Op<0>().init(Val, this);
-  Op<1>().init(Index, this);
+  Op<0>() = Val;
+  Op<1>() = Index;
   setName(Name);
 }
 
@@ -1127,8 +1127,8 @@
   Constant *Index = ConstantInt::get(Type::Int32Ty, IndexV);
   assert(isValidOperands(Val, Index) &&
          "Invalid extractelement instruction operands!");
-  Op<0>().init(Val, this);
-  Op<1>().init(Index, this);
+  Op<0>() = Val;
+  Op<1>() = Index;
   setName(Name);
 }
 
@@ -1143,8 +1143,8 @@
   assert(isValidOperands(Val, Index) &&
          "Invalid extractelement instruction operands!");
 
-  Op<0>().init(Val, this);
-  Op<1>().init(Index, this);
+  Op<0>() = Val;
+  Op<1>() = Index;
   setName(Name);
 }
 
@@ -1159,8 +1159,8 @@
   assert(isValidOperands(Val, Index) &&
          "Invalid extractelement instruction operands!");
   
-  Op<0>().init(Val, this);
-  Op<1>().init(Index, this);
+  Op<0>() = Val;
+  Op<1>() = Index;
   setName(Name);
 }
 
@@ -1179,9 +1179,9 @@
 InsertElementInst::InsertElementInst(const InsertElementInst &IE)
     : Instruction(IE.getType(), InsertElement,
                   OperandTraits<InsertElementInst>::op_begin(this), 3) {
-  Op<0>().init(IE.Op<0>(), this);
-  Op<1>().init(IE.Op<1>(), this);
-  Op<2>().init(IE.Op<2>(), this);
+  Op<0>() = IE.Op<0>();
+  Op<1>() = IE.Op<1>();
+  Op<2>() = IE.Op<2>();
 }
 InsertElementInst::InsertElementInst(Value *Vec, Value *Elt, Value *Index,
                                      const std::string &Name,
@@ -1191,9 +1191,9 @@
                 3, InsertBef) {
   assert(isValidOperands(Vec, Elt, Index) &&
          "Invalid insertelement instruction operands!");
-  Op<0>().init(Vec, this);
-  Op<1>().init(Elt, this);
-  Op<2>().init(Index, this);
+  Op<0>() = Vec;
+  Op<1>() = Elt;
+  Op<2>() = Index;
   setName(Name);
 }
 
@@ -1206,9 +1206,9 @@
   Constant *Index = ConstantInt::get(Type::Int32Ty, IndexV);
   assert(isValidOperands(Vec, Elt, Index) &&
          "Invalid insertelement instruction operands!");
-  Op<0>().init(Vec, this);
-  Op<1>().init(Elt, this);
-  Op<2>().init(Index, this);
+  Op<0>() = Vec;
+  Op<1>() = Elt;
+  Op<2>() = Index;
   setName(Name);
 }
 
@@ -1222,9 +1222,9 @@
   assert(isValidOperands(Vec, Elt, Index) &&
          "Invalid insertelement instruction operands!");
 
-  Op<0>().init(Vec, this);
-  Op<1>().init(Elt, this);
-  Op<2>().init(Index, this);
+  Op<0>() = Vec;
+  Op<1>() = Elt;
+  Op<2>() = Index;
   setName(Name);
 }
 
@@ -1238,9 +1238,9 @@
   assert(isValidOperands(Vec, Elt, Index) &&
          "Invalid insertelement instruction operands!");
   
-  Op<0>().init(Vec, this);
-  Op<1>().init(Elt, this);
-  Op<2>().init(Index, this);
+  Op<0>() = Vec;
+  Op<1>() = Elt;
+  Op<2>() = Index;
   setName(Name);
 }
 
@@ -1266,9 +1266,9 @@
   : Instruction(SV.getType(), ShuffleVector,
                 OperandTraits<ShuffleVectorInst>::op_begin(this),
                 OperandTraits<ShuffleVectorInst>::operands(this)) {
-  Op<0>().init(SV.Op<0>(), this);
-  Op<1>().init(SV.Op<1>(), this);
-  Op<2>().init(SV.Op<2>(), this);
+  Op<0>() = SV.Op<0>();
+  Op<1>() = SV.Op<1>();
+  Op<2>() = SV.Op<2>();
 }
 
 ShuffleVectorInst::ShuffleVectorInst(Value *V1, Value *V2, Value *Mask,
@@ -1280,9 +1280,9 @@
                 InsertBefore) {
   assert(isValidOperands(V1, V2, Mask) &&
          "Invalid shuffle vector instruction operands!");
-  Op<0>().init(V1, this);
-  Op<1>().init(V2, this);
-  Op<2>().init(Mask, this);
+  Op<0>() = V1;
+  Op<1>() = V2;
+  Op<2>() = Mask;
   setName(Name);
 }
 
@@ -1296,9 +1296,9 @@
   assert(isValidOperands(V1, V2, Mask) &&
          "Invalid shuffle vector instruction operands!");
 
-  Op<0>().init(V1, this);
-  Op<1>().init(V2, this);
-  Op<2>().init(Mask, this);
+  Op<0>() = V1;
+  Op<1>() = V2;
+  Op<2>() = Mask;
   setName(Name);
 }
 
@@ -1339,19 +1339,19 @@
 void InsertValueInst::init(Value *Agg, Value *Val, Value* const *Idx, unsigned NumIdx) {
   assert(NumOperands == 1+NumIdx && "NumOperands not initialized?");
   Use *OL = OperandList;
-  OL[0].init(Agg, this);
-  OL[1].init(Val, this);
+  OL[0] = Agg;
+  OL[1] = Val;
 
   for (unsigned i = 0; i != NumIdx; ++i)
-    OL[i+2].init(Idx[i], this);
+    OL[i+2] = Idx[i];
 }
 
 void InsertValueInst::init(Value *Agg, Value *Val, Value *Idx) {
   assert(NumOperands == 3 && "NumOperands not initialized?");
   Use *OL = OperandList;
-  OL[0].init(Agg, this);
-  OL[1].init(Val, this);
-  OL[2].init(Idx, this);
+  OL[0] = Agg;
+  OL[1] = Val;
+  OL[2] = Idx;
 }
 
 InsertValueInst::InsertValueInst(const InsertValueInst &IVI)
@@ -1362,7 +1362,7 @@
   Use *OL = OperandList;
   Use *IVIOL = IVI.OperandList;
   for (unsigned i = 0, E = NumOperands; i != E; ++i)
-    OL[i].init(IVIOL[i], this);
+    OL[i] = IVIOL[i];
 }
 
 //===----------------------------------------------------------------------===//
@@ -1372,17 +1372,17 @@
 void ExtractValueInst::init(Value *Agg, Value* const *Idx, unsigned NumIdx) {
   assert(NumOperands == 1+NumIdx && "NumOperands not initialized?");
   Use *OL = OperandList;
-  OL[0].init(Agg, this);
+  OL[0] = Agg;
 
   for (unsigned i = 0; i != NumIdx; ++i)
-    OL[i+1].init(Idx[i], this);
+    OL[i+1] = Idx[i];
 }
 
 void ExtractValueInst::init(Value *Agg, Value *Idx) {
   assert(NumOperands == 2 && "NumOperands not initialized?");
   Use *OL = OperandList;
-  OL[0].init(Agg, this);
-  OL[1].init(Idx, this);
+  OL[0] = Agg;
+  OL[1] = Idx;
 }
 
 ExtractValueInst::ExtractValueInst(const ExtractValueInst &EVI)
@@ -1393,7 +1393,7 @@
   Use *OL = OperandList;
   Use *EVIOL = EVI.OperandList;
   for (unsigned i = 0, E = NumOperands; i != E; ++i)
-    OL[i].init(EVIOL[i], this);
+    OL[i] = EVIOL[i];
 }
 
 // getIndexedType - Returns the type of the element that would be extracted
@@ -1434,8 +1434,8 @@
                 OperandTraits<BinaryOperator>::op_begin(this),
                 OperandTraits<BinaryOperator>::operands(this),
                 InsertBefore) {
-  Op<0>().init(S1, this);
-  Op<1>().init(S2, this);
+  Op<0>() = S1;
+  Op<1>() = S2;
   init(iType);
   setName(Name);
 }
@@ -1447,8 +1447,8 @@
                 OperandTraits<BinaryOperator>::op_begin(this),
                 OperandTraits<BinaryOperator>::operands(this),
                 InsertAtEnd) {
-  Op<0>().init(S1, this);
-  Op<1>().init(S2, this);
+  Op<0>() = S1;
+  Op<1>() = S2;
   init(iType);
   setName(Name);
 }
@@ -2419,8 +2419,8 @@
                 OperandTraits<CmpInst>::op_begin(this),
                 OperandTraits<CmpInst>::operands(this),
                 InsertBefore) {
-    Op<0>().init(LHS, this);
-    Op<1>().init(RHS, this);
+    Op<0>() = LHS;
+    Op<1>() = RHS;
   SubclassData = predicate;
   setName(Name);
 }
@@ -2432,8 +2432,8 @@
                 OperandTraits<CmpInst>::op_begin(this),
                 OperandTraits<CmpInst>::operands(this),
                 InsertAtEnd) {
-  Op<0>().init(LHS, this);
-  Op<1>().init(RHS, this);
+  Op<0>() = LHS;
+  Op<1>() = RHS;
   SubclassData = predicate;
   setName(Name);
 }
@@ -2687,8 +2687,8 @@
   NumOperands = 2;
   OperandList = allocHungoffUses(ReservedSpace);
 
-  OperandList[0].init(Value, this);
-  OperandList[1].init(Default, this);
+  OperandList[0] = Value;
+  OperandList[1] = Default;
 }
 
 /// SwitchInst ctor - Create a new switch instruction, specifying a value to
@@ -2716,8 +2716,8 @@
                    allocHungoffUses(SI.getNumOperands()), SI.getNumOperands()) {
   Use *OL = OperandList, *InOL = SI.OperandList;
   for (unsigned i = 0, E = SI.getNumOperands(); i != E; i+=2) {
-    OL[i].init(InOL[i], this);
-    OL[i+1].init(InOL[i+1], this);
+    OL[i] = InOL[i];
+    OL[i+1] = InOL[i+1];
   }
 }
 
@@ -2735,8 +2735,8 @@
   // Initialize some new operands.
   assert(OpNo+1 < ReservedSpace && "Growing didn't work!");
   NumOperands = OpNo+2;
-  OperandList[OpNo].init(OnVal, this);
-  OperandList[OpNo+1].init(Dest, this);
+  OperandList[OpNo] = OnVal;
+  OperandList[OpNo+1] = Dest;
 }
 
 /// removeCase - This method removes the specified successor from the switch
@@ -2790,7 +2790,7 @@
   Use *NewOps = allocHungoffUses(NumOps);
   Use *OldOps = OperandList;
   for (unsigned i = 0; i != e; ++i) {
-      NewOps[i].init(OldOps[i], this);
+      NewOps[i] = OldOps[i];
   }
   OperandList = NewOps;
   if (OldOps) Use::zap(OldOps, OldOps + e, true);





More information about the llvm-commits mailing list