[all-commits] [llvm/llvm-project] eddab9: [clang] Fix PointerAuth semantics of cpp_trivially...

Oliver Hunt via All-commits all-commits at lists.llvm.org
Mon Jun 16 02:12:43 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: eddab9b757722da7b908723a5a61d280540b48cf
      https://github.com/llvm/llvm-project/commit/eddab9b757722da7b908723a5a61d280540b48cf
  Author: Oliver Hunt <oliver at apple.com>
  Date:   2025-06-16 (Mon, 16 Jun 2025)

  Changed paths:
    M clang/include/clang/AST/ASTContext.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/Sema/SemaTypeTraits.cpp
    M clang/test/SemaCXX/cxx2c-trivially-relocatable.cpp
    M clang/test/SemaCXX/ptrauth-triviality.cpp
    A clang/test/SemaCXX/trivially-relocatable-ptrauth.cpp

  Log Message:
  -----------
  [clang] Fix PointerAuth semantics of cpp_trivially_relocatable (#143969)

This adds a number of functions to ASTContext to query whether a
type contains data protected with address discriminated pointer
authentication, and whether the protected values are just vtable
pointers, or if there are other address discriminated types included.

For the standardized version, __builtin_is_cpp_trivially_relocatable
this means accepting types where the only address discriminated
values are vtable pointers. Other address discriminated types are
not considered relocatable. In addition to that any union containing
any address discriminated data, including vtable pointers, is not
relocatable.

For the old deprecated __builtin_is_trivially_relocatable we reject
any type containing any address discriminated value, as it is
semantically intended as being a "is this memcopyable" which is
not true for anything with address discrimination.

This PR does not update the codegen for __builtin_trivially_relocate,
that will be in a follow on PR that is much more complex.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list