These versions still need wrapper but already have both success and
failure ordering.
(Compile tested on llvm 3.3, 3.7, 3.8.)
v2: don't duplicate whole function (suggested by Brian).
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111102
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
LLVMAtomicOrdering FailureOrdering,
LLVMBool SingleThread)
{
- /* LLVM 3.8 doesn't have a second ordering and uses old SynchronizationScope enum */
return llvm::wrap(llvm::unwrap(B)->CreateAtomicCmpXchg(llvm::unwrap(Ptr), llvm::unwrap(Cmp),
llvm::unwrap(New), mapFromLLVMOrdering(SuccessOrdering),
+#if HAVE_LLVM >= 0x305
+ mapFromLLVMOrdering(FailureOrdering),
+#endif
SingleThread ? llvm::SynchronizationScope::SingleThread : llvm::SynchronizationScope::CrossThread));
}
#endif