[PATCH] D13051: Add placeholder __libcpp_relaxed_store() for when atomic builtins are not available.

Dimitry Andric via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 22 04:23:39 PDT 2015

dim created this revision.
dim added reviewers: EricWF, mclow.lists.
dim added subscribers: majnemer, jroelofs, cfe-commits.
Herald added a subscriber: aemerson.

In rL241532, atomic_support.h was added, which provides handling of
atomic operations for libc++.  When atomic builtins are not available,
it emits a warning about being unsupported, but it still provides a
number of stubs for the required functions.

However, it misses a stub for __libcpp_relaxed_store().  Add it, by
using the same implementation as for __libcpp_atomic_store().

(Note that I encountered this on arm-freebsd, which still defaults to
armv4, and does not have the runtime libcalls to support atomic
builtins.  For now, I have simply disabled using them.)



Index: src/include/atomic_support.h
--- src/include/atomic_support.h
+++ src/include/atomic_support.h
@@ -103,6 +103,13 @@
     *__dest = __val;
+template <class _ValueType, class _FromType>
+void __libcpp_relaxed_store(_ValueType* __dest, _FromType __val)
+    *__dest = __val;
 template <class _ValueType>
 _ValueType __libcpp_atomic_load(_ValueType const* __val,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13051.35358.patch
Type: text/x-patch
Size: 515 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150922/5413fece/attachment.bin>

More information about the cfe-commits mailing list