diff options
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r-- | llvm/lib/IR/Core.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/IR/Function.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/IR/Instructions.cpp | 18 |
3 files changed, 17 insertions, 14 deletions
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp index 63b98f26ba1..84e279b8bbc 100644 --- a/llvm/lib/IR/Core.cpp +++ b/llvm/lib/IR/Core.cpp @@ -3450,8 +3450,8 @@ LLVMValueRef LLVMBuildMemCpy(LLVMBuilderRef B, LLVMValueRef Dst, unsigned DstAlign, LLVMValueRef Src, unsigned SrcAlign, LLVMValueRef Size) { - return wrap(unwrap(B)->CreateMemCpy(unwrap(Dst), MaybeAlign(DstAlign), - unwrap(Src), MaybeAlign(SrcAlign), + return wrap(unwrap(B)->CreateMemCpy(unwrap(Dst), DstAlign, + unwrap(Src), SrcAlign, unwrap(Size))); } @@ -3459,8 +3459,8 @@ LLVMValueRef LLVMBuildMemMove(LLVMBuilderRef B, LLVMValueRef Dst, unsigned DstAlign, LLVMValueRef Src, unsigned SrcAlign, LLVMValueRef Size) { - return wrap(unwrap(B)->CreateMemMove(unwrap(Dst), MaybeAlign(DstAlign), - unwrap(Src), MaybeAlign(SrcAlign), + return wrap(unwrap(B)->CreateMemMove(unwrap(Dst), DstAlign, + unwrap(Src), SrcAlign, unwrap(Size))); } diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp index 54612250b0d..fcf893bd4a3 100644 --- a/llvm/lib/IR/Function.cpp +++ b/llvm/lib/IR/Function.cpp @@ -126,11 +126,6 @@ unsigned Argument::getParamAlignment() const { return getParent()->getParamAlignment(getArgNo()); } -MaybeAlign Argument::getParamAlign() const { - assert(getType()->isPointerTy() && "Only pointers have alignments"); - return getParent()->getParamAlign(getArgNo()); -} - Type *Argument::getParamByValType() const { assert(getType()->isPointerTy() && "Only pointers have byval types"); return getParent()->getParamByValType(getArgNo()); diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index c264277fa53..2a49a758a46 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -1342,7 +1342,11 @@ void LoadInst::setAlignment(MaybeAlign Align) { "Alignment is greater than MaximumAlignment!"); setInstructionSubclassData((getSubclassDataFromInstruction() & ~(31 << 1)) | (encode(Align) << 1)); - assert(getAlign() == Align && "Alignment representation error!"); + if (Align) + assert(getAlignment() == Align->value() && + "Alignment representation error!"); + else + assert(getAlignment() == 0 && "Alignment representation error!"); } //===----------------------------------------------------------------------===// @@ -1412,12 +1416,16 @@ StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile, MaybeAlign Align, AssertOK(); } -void StoreInst::setAlignment(MaybeAlign Alignment) { - assert((!Alignment || *Alignment <= MaximumAlignment) && +void StoreInst::setAlignment(MaybeAlign Align) { + assert((!Align || *Align <= MaximumAlignment) && "Alignment is greater than MaximumAlignment!"); setInstructionSubclassData((getSubclassDataFromInstruction() & ~(31 << 1)) | - (encode(Alignment) << 1)); - assert(getAlign() == Alignment && "Alignment representation error!"); + (encode(Align) << 1)); + if (Align) + assert(getAlignment() == Align->value() && + "Alignment representation error!"); + else + assert(getAlignment() == 0 && "Alignment representation error!"); } //===----------------------------------------------------------------------===// |