about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-03-24 12:42:54 +0000
committerbors <bors@rust-lang.org>2020-03-24 12:42:54 +0000
commit374ab25585f0a817fe7bd6986737f12347b12d0b (patch)
tree60908a3b892fff185b7ac34e99636a1517bc9c7e /src/rustllvm/RustWrapper.cpp
parent1add455ec6f81045e7651c6225902823f5d4fbfa (diff)
parent497f879b1e24c369362bcd821959ffabc50a8a31 (diff)
downloadrust-374ab25585f0a817fe7bd6986737f12347b12d0b.tar.gz
rust-374ab25585f0a817fe7bd6986737f12347b12d0b.zip
Auto merge of #70163 - nikic:llvm-10-preparation, r=cuviper
Prepare for LLVM 10 upgrade

This is #67759 minus the submodule update.

 * Fix two compatibility issues in the rustllvm wrapper.
 * Update data layout strings in tests.
 * Fix LLVM version comparison (this become a problem because the major version has two digits now).

r? @cuviper
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 25cfee3373d..799adb41882 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -1333,8 +1333,13 @@ extern "C" LLVMValueRef LLVMRustBuildMemSet(LLVMBuilderRef B,
                                             LLVMValueRef Dst, unsigned DstAlign,
                                             LLVMValueRef Val,
                                             LLVMValueRef Size, bool IsVolatile) {
+#if LLVM_VERSION_GE(10, 0)
+  return wrap(unwrap(B)->CreateMemSet(
+      unwrap(Dst), unwrap(Val), unwrap(Size), MaybeAlign(DstAlign), IsVolatile));
+#else
   return wrap(unwrap(B)->CreateMemSet(
       unwrap(Dst), unwrap(Val), unwrap(Size), DstAlign, IsVolatile));
+#endif
 }
 
 extern "C" LLVMValueRef