[all-commits] [llvm/llvm-project] 6b5de1: Address discriminated __ptrauth should not be relo...
Oliver Hunt via All-commits
all-commits at lists.llvm.org
Sun Jun 15 03:39:30 PDT 2025
Branch: refs/heads/users/ojhunt/ptrauth-vs-trivial-relocation-sema-smol
Home: https://github.com/llvm/llvm-project
Commit: 6b5de16a8d45fc168d4f4a98907b9b5286b5aef8
https://github.com/llvm/llvm-project/commit/6b5de16a8d45fc168d4f4a98907b9b5286b5aef8
Author: Oliver Hunt <oliver at apple.com>
Date: 2025-06-15 (Sun, 15 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/ptrauth-triviality.cpp
M clang/test/SemaCXX/trivially-relocatable-ptrauth.cpp
Log Message:
-----------
Address discriminated __ptrauth should not be relocatable
After consideration, while "supportable" by relocation, it
seems much more reasonable for people to understand that
explicitly qualified types can have different relocatability
semantics.
Implicitly address discriminated fields should be relocatable
as developers in general cannot control those behaviours, hence
the trivial_relocation language explicitly acknowledges that
this impacts unions.
Explicitly address discriminated fields do however drastically
change the developer aware model of a type, and the practical
requirements for efficiently handling __ptrauth qualified types
mean that you would want
some_addr_discriminated_t[100];
to not be reported as trivially relocatable, while
struct {
...
some_addr_discriminated_t field;
...
}
to be reported as such, and the actual decision would regress
to what proportion of the object being relocated is subject to
such a policy.
Having is_trivially_relocatable change behaviour according to
some hypothetical internal heuristic is clearly a terrible
idea, and so I think for now we should instead simply limit
the application of trivial relocation to address discriminated
data to those fields that outside of the control of developers.
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