about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-02-22 19:10:13 +0000
committerbors <bors@rust-lang.org>2016-02-22 19:10:13 +0000
commitd3929b2c8a472244d448feb24f52bf91246d3e82 (patch)
tree6f0606ae73ab285195dc81dde5ea098c779a5988 /src/rustllvm/RustWrapper.cpp
parentd1f422ec280b881b8236c5d173103bc799e1590e (diff)
parent4fdbc2f1cb56cf47f535dbe2f250ca387f0278b6 (diff)
downloadrust-d3929b2c8a472244d448feb24f52bf91246d3e82.tar.gz
rust-d3929b2c8a472244d448feb24f52bf91246d3e82.zip
Auto merge of #30969 - Amanieu:extended_atomic_cmpxchg, r=alexcrichton
This is an implementation of rust-lang/rfcs#1443.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index ecf9146a1d0..4ebe49512d7 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -191,11 +191,15 @@ extern "C" LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B,
                                                LLVMValueRef old,
                                                LLVMValueRef source,
                                                AtomicOrdering order,
-                                               AtomicOrdering failure_order) {
-    return wrap(unwrap(B)->CreateAtomicCmpXchg(unwrap(target), unwrap(old),
-                                               unwrap(source), order,
-                                               failure_order
-                                               ));
+                                               AtomicOrdering failure_order,
+                                               LLVMBool weak) {
+    AtomicCmpXchgInst* acxi = unwrap(B)->CreateAtomicCmpXchg(unwrap(target),
+                                                             unwrap(old),
+                                                             unwrap(source),
+                                                             order,
+                                                             failure_order);
+    acxi->setWeak(weak);
+    return wrap(acxi);
 }
 extern "C" LLVMValueRef LLVMBuildAtomicFence(LLVMBuilderRef B,
                                              AtomicOrdering order,