[libcxx-commits] [PATCH] D56913: decoupling Freestanding atomic<T> from libatomic.a

Olivier Giroux via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 4 17:37:12 PST 2019


__simt__ updated this revision to Diff 185202.
__simt__ added a comment.

In this version I've restored the `__cxx_atomic_...` layer to which both the GCC and C11 backends map. This addresses the comment about introducing more functions named `__c11_atomic...` which are not part of the C11 builtin set. I do not introduce any new versions of `_Atomic` anymore.

There are four new configuration macros used by this patch:

- `_LIBCPP_FREESTANDING`, requests the mode decoupled from libatomic.a by introducing the non-lock-free specialization. I need to set this in the CUDA configuration.
- `_LIBCPP_HAS_EXTERNAL_ATOMIC_IMP`, indicates that there is an implementation of `__cxx_atomic_...` functions outside this file. For the CUDA configuration, I supply a scoped implementation.
- `_LIBCPP_ATOMIC_FLAG_TYPE`, allows the configuration to override the default type of `atomic_flag` and the non-lock-free specialization's type (the default is `bool`). I need to override this to be a 32-bit type, I don't have native 8-bit atomics.
- `_LIBCPP_ATOMIC_SCOPE_DEFAULT`, is there to plug the plumbing parameter that passes statically typed scope information through `__atomic_base` to the `__cxx_atomic_...` layer. It now defaults to a vacuous tag type `__cxx_atomic_scope`.

There are no new symbols being introduced outside of `std::v1::`, as there is no longer any attempt to grow the overload set of pre-existing functions.

Sorry if this once-again patch update scrambles the comments a bit.


Repository:
  rCXX libc++

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56913/new/

https://reviews.llvm.org/D56913

Files:
  libcxx/include/atomic

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56913.185202.patch
Type: text/x-patch
Size: 42089 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190205/dbaa6c37/attachment-0001.bin>


More information about the libcxx-commits mailing list