[libcxx-commits] [libcxx] [libc++] Implement C++20 atomic_ref (PR #76647)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 5 10:17:34 PST 2024


ldionne wrote:

> IMO, that is effectively superfluous and incompatible with the goal of C and C++ equivalency, and I don't really understand the rationale for adding it in the first place. If someone wants to use locked-atomics in a freestanding implementation, they should simply provide the requisite libatomic libcalls for their environment, end of story.
> 
> So, I think we should remove this third option. Or, at least, ignore it when implementing atomic_ref, and do just use the `__atomic_*` builtins directly.

I would support that too. https://reviews.llvm.org/D56913 happened a long time ago, and if it were to be done again, I might push back against that approach as being too ad-hoc. I'm not even certain we use this anywhere, and I'd argue that Freestanding does not equate there being no builtins. So +1 from me for removing it, at least at first glance.


https://github.com/llvm/llvm-project/pull/76647


More information about the libcxx-commits mailing list