[libcxx-commits] [PATCH] D122135: [libc++] Use [[no_unique_address]] in __compressed_pair in ABIv2

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 22 12:51:57 PDT 2022


ldionne requested changes to this revision.
ldionne added inline comments.
This revision now requires changes to proceed.


================
Comment at: libcxx/include/__memory/compressed_pair.h:164
+
+template <class _T1, class _T2>
+class __compressed_pair {
----------------
I would like to better understand the benefit of making this change. What do we gain? At a glance, we seem to gain EBO for types marked `final` -- I think that's it, right?

I wonder whether it's worth adding complexity for that, but I'm not closed to the idea.


================
Comment at: libcxx/include/__memory/shared_ptr.h:333
     // the same layout that we had when we used a compressed pair.
+#ifndef _LIBCPP_COMPRESSED_PAIR_USE_NO_UNIQUE_ADDRESS
     using _CompressedPair = __compressed_pair<_Alloc, _Tp>;
----------------
I don't think this part of the patch should be tied to the change in `__compressed_pair`. It's really not related -- the idea is only that if we're using the unstable ABI, we can suddenly simplify the implementation of the control block, but doing so has nothing to do with using `[[no_unqiue_address]]` inside `__compressed_pair`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122135



More information about the libcxx-commits mailing list