[clang] [PAC][clang] Define `PointerAuthQualifier` and `PointerAuthenticationMode` (PR #84384)

via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 7 13:49:18 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 9cf9cb271bf86bda4996be9a31fa413381f2f5e3 0b75c0a774e1e8afb56de95485acf447f11ccd6d -- clang/include/clang/Basic/PointerAuthOptions.h clang/include/clang/AST/ASTContext.h clang/include/clang/AST/AbstractBasicReader.h clang/include/clang/AST/AbstractBasicWriter.h clang/include/clang/AST/Type.h clang/include/clang/Basic/LangOptions.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h
index ad5eb1e3c6..4a855c11a6 100644
--- a/clang/include/clang/AST/Type.h
+++ b/clang/include/clang/AST/Type.h
@@ -169,8 +169,10 @@ class PointerAuthQualifier {
     DiscriminatorMask = ((1u << DiscriminatorBits) - 1) << DiscriminatorShift,
   };
 
-  // bits:     |0      |1      |2..3              |4          |5                |6..15|   16...31   |
-  //           |Enabled|Address|AuthenticationMode|ISA pointer|AuthenticatesNull|Key  |Discriminator|
+  // bits:     |0      |1      |2..3              |4          |5
+  // |6..15|   16...31   |
+  //           |Enabled|Address|AuthenticationMode|ISA
+  //           pointer|AuthenticatesNull|Key  |Discriminator|
   uint32_t Data;
 
   static_assert((EnabledBits + AddressDiscriminatedBits +
@@ -227,9 +229,9 @@ public:
     if (key == PointerAuthKeyNone)
       key = KeyNoneInternal;
     assert((key >= 0 && key <= KeyNoneInternal) && "out-of-range key value");
-    return PointerAuthQualifier(key, isAddressDiscriminated,
-                                extraDiscriminator, authenticationMode,
-                                isIsaPointer, authenticatesNullValues);
+    return PointerAuthQualifier(key, isAddressDiscriminated, extraDiscriminator,
+                                authenticationMode, isIsaPointer,
+                                authenticatesNullValues);
   }
 
   bool isPresent() const {
@@ -243,9 +245,7 @@ public:
     return (Data & KeyMask) >> KeyShift;
   }
 
-  bool hasKeyNone() const {
-    return isPresent() && getKey() == KeyNoneInternal;
-  }
+  bool hasKeyNone() const { return isPresent() && getKey() == KeyNoneInternal; }
 
   bool isAddressDiscriminated() const {
     assert(isPresent());
@@ -269,8 +269,7 @@ public:
 
   bool authenticatesNullValues() const {
     assert(isPresent());
-    return (Data & AuthenticatesNullValuesMask) >>
-           AuthenticatesNullValuesShift;
+    return (Data & AuthenticatesNullValuesMask) >> AuthenticatesNullValuesShift;
   }
 
   PointerAuthQualifier withoutKeyNone() const {

``````````

</details>


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


More information about the cfe-commits mailing list