about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/llvm
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2018-11-08 18:14:49 -0700
committerGitHub <noreply@github.com>2018-11-08 18:14:49 -0700
commit78cab361394c6cdb9ab950ff094bcc5e0635ce86 (patch)
treea8277b2651ce2045713d109115784658559c5297 /src/librustc_codegen_llvm/llvm
parent6153ce127aaed3fcef119a86762879c711bdc96c (diff)
parent463ad9098e12d1fbcfec2125d0ebfc6467866e38 (diff)
downloadrust-78cab361394c6cdb9ab950ff094bcc5e0635ce86.tar.gz
rust-78cab361394c6cdb9ab950ff094bcc5e0635ce86.zip
Rollup merge of #55633 - nikic:memcpy-align, r=nagisa
Support memcpy/memmove with differing src/dst alignment

If LLVM 7 is used, generate memcpy/memmove with differing src/dst alignment. I've added new FFI functions to construct these through the builder API, which is more convenient than dealing with differing intrinsic signatures depending on the LLVM version.

Fixes #49740.
Diffstat (limited to 'src/librustc_codegen_llvm/llvm')
-rw-r--r--src/librustc_codegen_llvm/llvm/ffi.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/librustc_codegen_llvm/llvm/ffi.rs b/src/librustc_codegen_llvm/llvm/ffi.rs
index 12d4670e4be..b994b1ffc4b 100644
--- a/src/librustc_codegen_llvm/llvm/ffi.rs
+++ b/src/librustc_codegen_llvm/llvm/ffi.rs
@@ -998,6 +998,22 @@ extern "C" {
                              Bundle: Option<&OperandBundleDef<'a>>,
                              Name: *const c_char)
                              -> &'a Value;
+    pub fn LLVMRustBuildMemCpy(B: &Builder<'a>,
+                               Dst: &'a Value,
+                               DstAlign: c_uint,
+                               Src: &'a Value,
+                               SrcAlign: c_uint,
+                               Size: &'a Value,
+                               IsVolatile: bool)
+                               -> &'a Value;
+    pub fn LLVMRustBuildMemMove(B: &Builder<'a>,
+                                Dst: &'a Value,
+                                DstAlign: c_uint,
+                                Src: &'a Value,
+                                SrcAlign: c_uint,
+                                Size: &'a Value,
+                                IsVolatile: bool)
+                                -> &'a Value;
     pub fn LLVMBuildSelect(B: &Builder<'a>,
                            If: &'a Value,
                            Then: &'a Value,