[llvm-branch-commits] [clang] [Clang] Add pointer field protection feature. (PR #172119)
Peter Collingbourne via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Jan 12 19:34:56 PST 2026
================
@@ -253,4 +253,10 @@ FIELD(IsAnyDestructorNoReturn, 1, NO_MERGE)
/// type that is intangible). HLSL only.
FIELD(IsHLSLIntangible, 1, NO_MERGE)
+/// Whether the pointer fields in this class should have pointer field
+/// protection (PFP) by default, either because of an attribute, the
+/// -fexperimental-pointer-field-protection-abi compiler flag or inheritance
+/// from a base or member with PFP.
+FIELD(IsPFPType, 1, NO_MERGE)
----------------
pcc wrote:
I don't have a strong opinion, but given that this being gated by a langopt is a temporary state while the feature is experimental, it's free to add this bit as long as we have some padding available in DefinitionData (6 bits of padding after this change), and bits are added here rarely (none since 2021 except for one added in 2024), I think it's probably not worth it to move it to the side table.
https://github.com/llvm/llvm-project/pull/172119
More information about the llvm-branch-commits
mailing list