[libcxx-commits] [PATCH] D142972: [libc++] Granularize <atomic>

Paul Kirth via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Feb 17 10:40:19 PST 2023


paulkirth added inline comments.


================
Comment at: libcxx/include/__atomic/cxx_atomic_impl.h:773
+template <typename _Tp,
+          typename _Base = typename conditional<__libcpp_is_always_lock_free<_Tp>::__value,
+                                                __cxx_atomic_base_impl<_Tp>,
----------------
philnik wrote:
> paulkirth wrote:
> > I think the use of `__libcpp_is_always_lock_free` requires a new `#include <__atomic/is_always_lock_free.h>`, doesn't it?
> > 
> > We're seeing some build failures after this change that appear to be caused by a missing include. If that is the case can you provide a forward fix?
> > 
> > Here's our error message, and a link to our failing bot.
> > ```
> > [38461/300130](185) CXX kernel.efi_x64/obj/src/lib/utf_conversion/libutf_conversion.utf_conversion.cc.o
> > FAILED: kernel.efi_x64/obj/src/lib/utf_conversion/libutf_conversion.utf_conversion.cc.o
> > ../../../recipe_cleanup/clangr8n6ja_c/bin/clang++ -MD -MF kernel.efi_x64/obj/src/lib/utf_conversion/libutf_conversion.utf_conversion.cc.o.d -o kernel.efi_x64/obj/src/lib/utf_conversion/libutf_conversion.utf_conversion.cc.o -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DZX_ASSERT_LEVEL=2 -DWITH_FRAME_POINTERS=1 -I../../zircon/system/public -I../../sdk/lib...
> > In file included from ../../src/lib/utf_conversion/utf_conversion.cc:7:
> > In file included from ../../sdk/lib/stdcompat/include/lib/stdcompat/bit.h:12:
> > In file included from ../../sdk/lib/stdcompat/include/lib/stdcompat/memory.h:8:
> > In file included from ../../../recipe_cleanup/clangr8n6ja_c/include/c++/v1/memory:898:
> > In file included from ../../../recipe_cleanup/clangr8n6ja_c/include/c++/v1/__memory/shared_ptr.h:42:
> > In file included from ../../../recipe_cleanup/clangr8n6ja_c/include/c++/v1/atomic:522:
> > In file included from ../../../recipe_cleanup/clangr8n6ja_c/include/c++/v1/__atomic/aliases.h:12:
> > In file included from ../../../recipe_cleanup/clangr8n6ja_c/include/c++/v1/__atomic/atomic.h:12:
> > In file included from ../../../recipe_cleanup/clangr8n6ja_c/include/c++/v1/__atomic/atomic_base.h:12:
> > In file included from ../../../recipe_cleanup/clangr8n6ja_c/include/c++/v1/__atomic/atomic_sync.h:12:
> > In file included from ../../../recipe_cleanup/clangr8n6ja_c/include/c++/v1/__atomic/contention_t.h:12:
> > ../../../recipe_cleanup/clangr8n6ja_c/include/c++/v1/__atomic/cxx_atomic_impl.h:773:49: error: no template named '__libcpp_is_always_lock_free'
> >           typename _Base = typename conditional<__libcpp_is_always_lock_free<_Tp>::__value,
> >                                                 ^
> > ../../../recipe_cleanup/clangr8n6ja_c/include/c++/v1/__atomic/cxx_atomic_impl.h:775:80: error: no type named 'type' in the global namespace
> >                                                 __cxx_atomic_lock_impl<_Tp> >::type>
> >                                                                              ~~^
> > ../../../recipe_cleanup/clangr8n6ja_c/include/c++/v1/__atomic/cxx_atomic_impl.h:775:84: error: expected unqualified-id
> >                                                 __cxx_atomic_lock_impl<_Tp> >::type>
> > ```
> > 
> > https://ci.chromium.org/ui/p/fuchsia/builders/ci/clang_toolchain.ci.core.x64-debug-tot-build_only/b8788907734054093697/overview
> > 
> Thanks for the report! I fixed it in 21a543656cf4840023078359a6c7e0db7d5391b2. We should definitely get a runner for a minimal freestanding implementation to catch these kinds of problems.
Thanks for the quick fix. Fuchsia's build is a bit complex, so I wasn't 100% sure there wasn't' something wacky going on.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142972



More information about the libcxx-commits mailing list