Switch to using MaybeAlign APIs

The integer versions are deprecated
This commit is contained in:
Nikita Popov 2019-12-31 14:32:01 +01:00
parent 6d59017132
commit c3ab84bb4f

View file

@ -1266,20 +1266,34 @@ extern "C" LLVMValueRef LLVMRustBuildMemCpy(LLVMBuilderRef B,
LLVMValueRef Dst, unsigned DstAlign, LLVMValueRef Dst, unsigned DstAlign,
LLVMValueRef Src, unsigned SrcAlign, LLVMValueRef Src, unsigned SrcAlign,
LLVMValueRef Size, bool IsVolatile) { LLVMValueRef Size, bool IsVolatile) {
#if LLVM_VERSION_GE(10, 0)
return wrap(unwrap(B)->CreateMemCpy(
unwrap(Dst), MaybeAlign(DstAlign),
unwrap(Src), MaybeAlign(SrcAlign),
unwrap(Size), IsVolatile));
#else
return wrap(unwrap(B)->CreateMemCpy( return wrap(unwrap(B)->CreateMemCpy(
unwrap(Dst), DstAlign, unwrap(Dst), DstAlign,
unwrap(Src), SrcAlign, unwrap(Src), SrcAlign,
unwrap(Size), IsVolatile)); unwrap(Size), IsVolatile));
#endif
} }
extern "C" LLVMValueRef LLVMRustBuildMemMove(LLVMBuilderRef B, extern "C" LLVMValueRef LLVMRustBuildMemMove(LLVMBuilderRef B,
LLVMValueRef Dst, unsigned DstAlign, LLVMValueRef Dst, unsigned DstAlign,
LLVMValueRef Src, unsigned SrcAlign, LLVMValueRef Src, unsigned SrcAlign,
LLVMValueRef Size, bool IsVolatile) { LLVMValueRef Size, bool IsVolatile) {
#if LLVM_VERSION_GE(10, 0)
return wrap(unwrap(B)->CreateMemMove(
unwrap(Dst), MaybeAlign(DstAlign),
unwrap(Src), MaybeAlign(SrcAlign),
unwrap(Size), IsVolatile));
#else
return wrap(unwrap(B)->CreateMemMove( return wrap(unwrap(B)->CreateMemMove(
unwrap(Dst), DstAlign, unwrap(Dst), DstAlign,
unwrap(Src), SrcAlign, unwrap(Src), SrcAlign,
unwrap(Size), IsVolatile)); unwrap(Size), IsVolatile));
#endif
} }
extern "C" LLVMValueRef extern "C" LLVMValueRef