[lld] [lld][GNU Properties] Refactor storage of PAuth ABI core info (PR #141920)

via llvm-commits llvm-commits at lists.llvm.org
Thu May 29 06:31:42 PDT 2025


================
@@ -695,7 +701,7 @@ struct Ctx : CommonLinkerContext {
 
   llvm::raw_fd_ostream openAuxiliaryFile(llvm::StringRef, std::error_code &);
 
-  ArrayRef<uint8_t> aarch64PauthAbiCoreInfo;
+  std::optional<AArch64PauthAbiCoreInfo> aarch64PauthAbiCoreInfo;
----------------
sivan-shani wrote:

`std::optional` seems to fits here. This is a simple value-type struct that may or may not be present, and `optional` makes that clear without needing dynamic allocation or extra indirection.

A raw pointer would mean managing lifetime manually or implying ownership we don’t intend. With `optional`, it’s clear that the value lives directly in the parent object and is just conditionally present. It also avoids null checks and makes the intent more explicit.

https://github.com/llvm/llvm-project/pull/141920


More information about the llvm-commits mailing list