aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2007-07-18 20:51:11 +0000
committerDan Gohman <gohman@apple.com>2007-07-18 20:51:11 +0000
commit6ab2d18f5ea44bf740964036e08253b75ab601f9 (patch)
tree1a419123f2b034c94ededc8a5f03225cd3caf85b /lib
parent4106f3714e8fc2d3561a3e64244d560b4cc41837 (diff)
Add constructor overloads for LoadInst and StoreInst that insert at the
end of a BasicBlock and have an alignment parameter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40016 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Instructions.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index acb2e35be5..7dfe5aef20 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -740,6 +740,16 @@ LoadInst::LoadInst(Value *Ptr, const std::string &Name, bool isVolatile,
setName(Name);
}
+LoadInst::LoadInst(Value *Ptr, const std::string &Name, bool isVolatile,
+ unsigned Align, BasicBlock *InsertAE)
+ : UnaryInstruction(cast<PointerType>(Ptr->getType())->getElementType(),
+ Load, Ptr, InsertAE) {
+ setVolatile(isVolatile);
+ setAlignment(Align);
+ AssertOK();
+ setName(Name);
+}
+
LoadInst::LoadInst(Value *Ptr, const std::string &Name, bool isVolatile,
BasicBlock *InsertAE)
: UnaryInstruction(cast<PointerType>(Ptr->getType())->getElementType(),
@@ -847,6 +857,16 @@ StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile,
}
StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile,
+ unsigned Align, BasicBlock *InsertAtEnd)
+ : Instruction(Type::VoidTy, Store, Ops, 2, InsertAtEnd) {
+ Ops[0].init(val, this);
+ Ops[1].init(addr, this);
+ setVolatile(isVolatile);
+ setAlignment(Align);
+ AssertOK();
+}
+
+StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile,
BasicBlock *InsertAtEnd)
: Instruction(Type::VoidTy, Store, Ops, 2, InsertAtEnd) {
Ops[0].init(val, this);