[llvm-branch-commits] [libcxx] Prepare libcxx and libcxxabi for pointer field protection. (PR #151651)
Peter Collingbourne via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Mar 25 09:53:59 PDT 2026
================
@@ -34,10 +34,13 @@ template <class _Tp, class = void>
struct __libcpp_is_trivially_relocatable : is_trivially_copyable<_Tp> {};
#endif
+// __trivially_relocatable on libc++'s builtin types does not currently return the right answer with PFP.
----------------
pcc wrote:
It's not the pointer type itself that becomes non-TR but rather the pointer field. So `__libcpp_is_trivially_relocatable<_Tp*>` returning false may result in unnecessary pessimizations. We may consider adding something like `__libcpp_is_field_trivially_relocatable` with that partial specialization and having `locale` etc use that. But I think I'd still mildly prefer to keep these optimizations out for the initial version of the patch, as they add some complexity, and I'd rather spend the "complexity budget" on annotating the RTTI types.
https://github.com/llvm/llvm-project/pull/151651
More information about the llvm-branch-commits
mailing list