aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-07-01 20:22:31 +0000
committerChris Lattner <sabre@nondot.org>2004-07-01 20:22:31 +0000
commitcf3290b04ad18e6329dd3efd67b0fabf0ca939d0 (patch)
tree7ca098e8a97b24e68a3813cf048c81fb996d88e9
parent74f470b20c2421b963035156edf3d7736e0d755c (diff)
Move init methods out of line to enable better assertions, contributed
by Vladimir Merzliakov! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14545 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/iMemory.h18
1 files changed, 4 insertions, 14 deletions
diff --git a/include/llvm/iMemory.h b/include/llvm/iMemory.h
index 1f9f25fce8..54215821b0 100644
--- a/include/llvm/iMemory.h
+++ b/include/llvm/iMemory.h
@@ -175,14 +175,10 @@ public:
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 @@ public:
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);