diff options
| author | Anthony Ramine <n.oxyde@gmail.com> | 2018-05-11 11:26:51 +0200 |
|---|---|---|
| committer | Anthony Ramine <n.oxyde@gmail.com> | 2018-05-13 10:36:28 +0200 |
| commit | b638f11b4230ad2e098a75474c36a10de1653d0d (patch) | |
| tree | 6e38d198fde8c8f42253ce659e386d5af2a188c5 /src/librustc_trans/builder.rs | |
| parent | 6fc409ed0938cd2f501642abcaa675977fa5035a (diff) | |
| download | rust-b638f11b4230ad2e098a75474c36a10de1653d0d.tar.gz rust-b638f11b4230ad2e098a75474c36a10de1653d0d.zip | |
Introduce OperandValue::volatile_store and use it in the intrinsics
Fixes #50371.
Diffstat (limited to 'src/librustc_trans/builder.rs')
| -rw-r--r-- | src/librustc_trans/builder.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustc_trans/builder.rs b/src/librustc_trans/builder.rs index db803ca8209..49bcf9b88a0 100644 --- a/src/librustc_trans/builder.rs +++ b/src/librustc_trans/builder.rs @@ -590,13 +590,14 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { } } - pub fn volatile_store(&self, val: ValueRef, ptr: ValueRef) -> ValueRef { + pub fn volatile_store(&self, val: ValueRef, ptr: ValueRef, align: Align) -> ValueRef { debug!("Store {:?} -> {:?}", Value(val), Value(ptr)); assert!(!self.llbuilder.is_null()); self.count_insn("store.volatile"); let ptr = self.check_store(val, ptr); unsafe { let insn = llvm::LLVMBuildStore(self.llbuilder, val, ptr); + llvm::LLVMSetAlignment(insn, align.abi() as c_uint); llvm::LLVMSetVolatile(insn, llvm::True); insn } |
