aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Instructions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/Instructions.cpp')
-rw-r--r--lib/VMCore/Instructions.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index 7de5602..96a010b 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -494,18 +494,18 @@ static Value *getAISize(Value *Amt) {
}
AllocationInst::AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy,
- const std::string &Name,
+ unsigned Align, const std::string &Name,
Instruction *InsertBefore)
: UnaryInstruction(PointerType::get(Ty), iTy, getAISize(ArraySize),
- Name, InsertBefore) {
+ Name, InsertBefore), Alignment(Align) {
assert(Ty != Type::VoidTy && "Cannot allocate void!");
}
AllocationInst::AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy,
- const std::string &Name,
+ unsigned Align, const std::string &Name,
BasicBlock *InsertAtEnd)
: UnaryInstruction(PointerType::get(Ty), iTy, getAISize(ArraySize),
- Name, InsertAtEnd) {
+ Name, InsertAtEnd), Alignment(Align) {
assert(Ty != Type::VoidTy && "Cannot allocate void!");
}
@@ -521,12 +521,12 @@ const Type *AllocationInst::getAllocatedType() const {
AllocaInst::AllocaInst(const AllocaInst &AI)
: AllocationInst(AI.getType()->getElementType(), (Value*)AI.getOperand(0),
- Instruction::Alloca) {
+ Instruction::Alloca, AI.getAlignment()) {
}
MallocInst::MallocInst(const MallocInst &MI)
: AllocationInst(MI.getType()->getElementType(), (Value*)MI.getOperand(0),
- Instruction::Malloc) {
+ Instruction::Malloc, MI.getAlignment()) {
}
//===----------------------------------------------------------------------===//