diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2018-11-02 23:38:16 +0100 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2018-11-04 18:54:37 +0100 |
| commit | 463ad9098e12d1fbcfec2125d0ebfc6467866e38 (patch) | |
| tree | 0c82c5b2b35aeb14a9daaa9125adcbf5dbf03f29 /src/librustc_codegen_llvm/llvm | |
| parent | ac708826b0d97e105f91a4cde41bfe14cff032f2 (diff) | |
| download | rust-463ad9098e12d1fbcfec2125d0ebfc6467866e38.tar.gz rust-463ad9098e12d1fbcfec2125d0ebfc6467866e38.zip | |
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.
Diffstat (limited to 'src/librustc_codegen_llvm/llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/llvm/ffi.rs | 16 |
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 f046ea03027..64066d4d786 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, |
