mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-28 06:27:16 +00:00
verify that alignments are always a power of 2
llvm-svn: 24200
This commit is contained in:
parent
a0d532c757
commit
c6ef0112c0
@ -498,6 +498,7 @@ AllocationInst::AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy,
|
||||
Instruction *InsertBefore)
|
||||
: UnaryInstruction(PointerType::get(Ty), iTy, getAISize(ArraySize),
|
||||
Name, InsertBefore), Alignment(Align) {
|
||||
assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!");
|
||||
assert(Ty != Type::VoidTy && "Cannot allocate void!");
|
||||
}
|
||||
|
||||
@ -506,6 +507,7 @@ AllocationInst::AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy,
|
||||
BasicBlock *InsertAtEnd)
|
||||
: UnaryInstruction(PointerType::get(Ty), iTy, getAISize(ArraySize),
|
||||
Name, InsertAtEnd), Alignment(Align) {
|
||||
assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!");
|
||||
assert(Ty != Type::VoidTy && "Cannot allocate void!");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user