[clang] [llvm] [Support] Add SipHash-based 16/64-bit ptrauth stable hash. (PR #93902)

via cfe-commits cfe-commits at lists.llvm.org
Fri May 31 13:12:21 PDT 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 8578b60758e6a588ec41a9678829cebec471f8e5 8e9ab9cfe45e6c958046d5a9575aedfc4cb29c0c -- llvm/include/llvm/Support/SipHash.h llvm/lib/Support/SipHash.cpp llvm/unittests/Support/SipHashTest.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/unittests/Support/SipHashTest.cpp b/llvm/unittests/Support/SipHashTest.cpp
index 1a8143d9c9..77e60109df 100644
--- a/llvm/unittests/Support/SipHashTest.cpp
+++ b/llvm/unittests/Support/SipHashTest.cpp
@@ -7,8 +7,8 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Support/SipHash.h"
-#include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/StringRef.h"
 #include "llvm/Support/raw_ostream.h"
 #include "gtest/gtest.h"
 
@@ -33,10 +33,10 @@ TEST(SipHashTest, PointerAuthSipHash) {
   EXPECT_EQ(0xC310U, getPointerAuthStableSipHash16("method_list_t"));
 
   // Test the limits that apply to 16 bit results but don't to 64 bit results.
-  EXPECT_EQ(1U,                  getPointerAuthStableSipHash16("_Zptrkvttf"));
+  EXPECT_EQ(1U, getPointerAuthStableSipHash16("_Zptrkvttf"));
   EXPECT_EQ(0x314FD87E0611F020U, getPointerAuthStableSipHash64("_Zptrkvttf"));
 
-  EXPECT_EQ(0xFFFFU,             getPointerAuthStableSipHash16("_Zaflhllod"));
+  EXPECT_EQ(0xFFFFU, getPointerAuthStableSipHash16("_Zaflhllod"));
   EXPECT_EQ(0x1292F635FB3DFBF8U, getPointerAuthStableSipHash64("_Zaflhllod"));
 }
 

``````````

</details>


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


More information about the cfe-commits mailing list