Implement new simpler constructors for if you don't have a index list
authorChris Lattner <sabre@nondot.org>
Thu, 1 Nov 2001 05:58:42 +0000 (05:58 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 1 Nov 2001 05:58:42 +0000 (05:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1081 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/iMemory.cpp

index eefeeefdc173084a9c623a21ca2c2efe70d3de82..cc24ca144120ec8162dd8e250f2ab41180c6e7fd 100644 (file)
@@ -60,6 +60,13 @@ LoadInst::LoadInst(Value *Ptr, const vector<ConstPoolVal*> &Idx,
   
 }
 
+LoadInst::LoadInst(Value *Ptr, const string &Name = "")
+  : MemAccessInst(cast<PointerType>(Ptr->getType())->getValueType(),
+                  Load, vector<ConstPoolVal*>(), Name) {
+  Operands.reserve(1);
+  Operands.push_back(Use(Ptr, this));
+}
+
 
 //===----------------------------------------------------------------------===//
 //                           StoreInst Implementation
@@ -78,6 +85,14 @@ StoreInst::StoreInst(Value *Val, Value *Ptr, const vector<ConstPoolVal*> &Idx,
     Operands.push_back(Use(Idx[i], this));
 }
 
+StoreInst::StoreInst(Value *Val, Value *Ptr, const string &Name = "")
+  : MemAccessInst(Type::VoidTy, Store, vector<ConstPoolVal*>(), Name) {
+  
+  Operands.reserve(2);
+  Operands.push_back(Use(Val, this));
+  Operands.push_back(Use(Ptr, this));
+}
+
 
 //===----------------------------------------------------------------------===//
 //                       GetElementPtrInst Implementation