[llvm-branch-commits] [clang] [Clang] Add pointer field protection feature. (PR #172119)
Florian Mayer via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Jan 13 08:30:16 PST 2026
================
@@ -15227,3 +15227,91 @@ bool ASTContext::useAbbreviatedThunkName(GlobalDecl VirtualMethodDecl,
ThunksToBeAbbreviated[VirtualMethodDecl] = std::move(SimplifiedThunkNames);
return Result;
}
+
+bool ASTContext::arePFPFieldsTriviallyCopyable(const RecordDecl *RD) const {
+ bool IsPAuthSupported =
+ getTargetInfo().getTriple().getArch() == llvm::Triple::aarch64;
+ if (!IsPAuthSupported)
+ return true;
+ if (getLangOpts().PointerFieldProtectionTagged)
----------------
fmayer wrote:
super nit: maybe make this
```cc
if (!IsPAuthSupported || getLangOpts().PointerFieldProtectionTagged)
return true;
return !isa<CXXRecordDecl>(RD) || cast<CXXRecordDecl>(RD)->hasTrivialDestructor();
```
https://github.com/llvm/llvm-project/pull/172119
More information about the llvm-branch-commits
mailing list