[llvm] [Dwarf] Support `__ptrauth` qualifier in metadata nodes (PR #82363)

Jonas Devlieghere via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 11:50:40 PST 2024


================
@@ -1048,6 +1096,48 @@ class DIDerivedType : public DIType {
     return DWARFAddressSpace;
   }
 
+  std::optional<PtrAuthData> getPtrAuthData() const {
+    return getTag() == dwarf::DW_TAG_LLVM_ptrauth_type
+               ? std::optional<PtrAuthData>(PtrAuthData(SubclassData32))
+               : std::nullopt;
+  }
+
+  /// \returns The PointerAuth key.
+  std::optional<unsigned> getPtrAuthKey() const {
+    if (auto PtrAuthData = getPtrAuthData())
+      return (unsigned)PtrAuthData->Payload.Data.Key;
+    else
+      return std::nullopt;
----------------
JDevlieghere wrote:

No else after return? Same below.

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


More information about the llvm-commits mailing list