Skip to content

Commit c3ab84b

Browse files
committed
Switch to using MaybeAlign APIs
The integer versions are deprecated
1 parent 6d59017 commit c3ab84b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/rustllvm/RustWrapper.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,20 +1266,34 @@ extern "C" LLVMValueRef LLVMRustBuildMemCpy(LLVMBuilderRef B,
12661266
LLVMValueRef Dst, unsigned DstAlign,
12671267
LLVMValueRef Src, unsigned SrcAlign,
12681268
LLVMValueRef Size, bool IsVolatile) {
1269+
#if LLVM_VERSION_GE(10, 0)
1270+
return wrap(unwrap(B)->CreateMemCpy(
1271+
unwrap(Dst), MaybeAlign(DstAlign),
1272+
unwrap(Src), MaybeAlign(SrcAlign),
1273+
unwrap(Size), IsVolatile));
1274+
#else
12691275
return wrap(unwrap(B)->CreateMemCpy(
12701276
unwrap(Dst), DstAlign,
12711277
unwrap(Src), SrcAlign,
12721278
unwrap(Size), IsVolatile));
1279+
#endif
12731280
}
12741281

12751282
extern "C" LLVMValueRef LLVMRustBuildMemMove(LLVMBuilderRef B,
12761283
LLVMValueRef Dst, unsigned DstAlign,
12771284
LLVMValueRef Src, unsigned SrcAlign,
12781285
LLVMValueRef Size, bool IsVolatile) {
1286+
#if LLVM_VERSION_GE(10, 0)
1287+
return wrap(unwrap(B)->CreateMemMove(
1288+
unwrap(Dst), MaybeAlign(DstAlign),
1289+
unwrap(Src), MaybeAlign(SrcAlign),
1290+
unwrap(Size), IsVolatile));
1291+
#else
12791292
return wrap(unwrap(B)->CreateMemMove(
12801293
unwrap(Dst), DstAlign,
12811294
unwrap(Src), SrcAlign,
12821295
unwrap(Size), IsVolatile));
1296+
#endif
12831297
}
12841298

12851299
extern "C" LLVMValueRef

0 commit comments

Comments
 (0)