[llvm-commits] CVS: llvm/include/llvm/iMemory.h

Chris Lattner lattner at cs.uiuc.edu
Thu Jul 1 15:25:02 PDT 2004


Changes in directory llvm/include/llvm:

iMemory.h updated: 1.46 -> 1.47

---
Log message:

Move init methods out of line to enable better assertions, contributed
by Vladimir Merzliakov!


---
Diffs of the changes:  (+4 -14)

Index: llvm/include/llvm/iMemory.h
diff -u llvm/include/llvm/iMemory.h:1.46 llvm/include/llvm/iMemory.h:1.47
--- llvm/include/llvm/iMemory.h:1.46	Wed May 26 19:15:23 2004
+++ llvm/include/llvm/iMemory.h	Thu Jul  1 15:22:31 2004
@@ -175,14 +175,10 @@
 class LoadInst : public Instruction {
   LoadInst(const LoadInst &LI) : Instruction(LI.getType(), Load) {
     Volatile = LI.isVolatile();
-    Operands.reserve(1);
-    Operands.push_back(Use(LI.Operands[0], this));
+    init(LI.Operands[0]);
   }
   bool Volatile;   // True if this is a volatile load
-  void init(Value *Ptr) {
-    Operands.reserve(1);
-    Operands.push_back(Use(Ptr, this));
-  }
+  void init(Value *Ptr);
 public:
   LoadInst(Value *Ptr, const std::string &Name, Instruction *InsertBefore);
   LoadInst(Value *Ptr, const std::string &Name, BasicBlock *InsertAtEnd);
@@ -228,16 +224,10 @@
 class StoreInst : public Instruction {
   StoreInst(const StoreInst &SI) : Instruction(SI.getType(), Store) {
     Volatile = SI.isVolatile();
-    Operands.reserve(2);
-    Operands.push_back(Use(SI.Operands[0], this));
-    Operands.push_back(Use(SI.Operands[1], this));
+    init(SI.Operands[0], SI.Operands[1]);
   }
   bool Volatile;   // True if this is a volatile store
-  void init(Value *Val, Value *Ptr) {
-    Operands.reserve(2);
-    Operands.push_back(Use(Val, this));
-    Operands.push_back(Use(Ptr, this));
-  }
+  void init(Value *Val, Value *Ptr);
 public:
   StoreInst(Value *Val, Value *Ptr, Instruction *InsertBefore);
   StoreInst(Value *Val, Value *Ptr, BasicBlock *InsertAtEnd);





More information about the llvm-commits mailing list