diff options
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
| -rw-r--r-- | llvm/lib/IR/Instructions.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index 245c7628b08..f62ec8fbec1 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -1217,30 +1217,31 @@ AllocaInst::AllocaInst(Type *Ty, unsigned AddrSpace, const Twine &Name, AllocaInst::AllocaInst(Type *Ty, unsigned AddrSpace, Value *ArraySize, const Twine &Name, Instruction *InsertBefore) - : AllocaInst(Ty, AddrSpace, ArraySize, /*Align=*/0, Name, InsertBefore) {} + : AllocaInst(Ty, AddrSpace, ArraySize, /*Align=*/None, Name, InsertBefore) { +} AllocaInst::AllocaInst(Type *Ty, unsigned AddrSpace, Value *ArraySize, const Twine &Name, BasicBlock *InsertAtEnd) - : AllocaInst(Ty, AddrSpace, ArraySize, /*Align=*/0, Name, InsertAtEnd) {} + : AllocaInst(Ty, AddrSpace, ArraySize, /*Align=*/None, Name, InsertAtEnd) {} AllocaInst::AllocaInst(Type *Ty, unsigned AddrSpace, Value *ArraySize, - unsigned Align, const Twine &Name, + MaybeAlign Align, const Twine &Name, Instruction *InsertBefore) - : UnaryInstruction(PointerType::get(Ty, AddrSpace), Alloca, - getAISize(Ty->getContext(), ArraySize), InsertBefore), - AllocatedType(Ty) { + : UnaryInstruction(PointerType::get(Ty, AddrSpace), Alloca, + getAISize(Ty->getContext(), ArraySize), InsertBefore), + AllocatedType(Ty) { setAlignment(MaybeAlign(Align)); assert(!Ty->isVoidTy() && "Cannot allocate void!"); setName(Name); } AllocaInst::AllocaInst(Type *Ty, unsigned AddrSpace, Value *ArraySize, - unsigned Align, const Twine &Name, + MaybeAlign Align, const Twine &Name, BasicBlock *InsertAtEnd) - : UnaryInstruction(PointerType::get(Ty, AddrSpace), Alloca, - getAISize(Ty->getContext(), ArraySize), InsertAtEnd), + : UnaryInstruction(PointerType::get(Ty, AddrSpace), Alloca, + getAISize(Ty->getContext(), ArraySize), InsertAtEnd), AllocatedType(Ty) { - setAlignment(MaybeAlign(Align)); + setAlignment(Align); assert(!Ty->isVoidTy() && "Cannot allocate void!"); setName(Name); } @@ -4126,9 +4127,9 @@ InsertValueInst *InsertValueInst::cloneImpl() const { } AllocaInst *AllocaInst::cloneImpl() const { - AllocaInst *Result = new AllocaInst(getAllocatedType(), - getType()->getAddressSpace(), - (Value *)getOperand(0), getAlignment()); + AllocaInst *Result = + new AllocaInst(getAllocatedType(), getType()->getAddressSpace(), + (Value *)getOperand(0), MaybeAlign(getAlignment())); Result->setUsedWithInAlloca(isUsedWithInAlloca()); Result->setSwiftError(isSwiftError()); return Result; |

