[llvm] [IR][AArch64] Add "ptrauth(...)" Constant to represent signed pointers. (PR #85738)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 23:09:20 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 0c423af59c971ddf1aa12d94529edf8293608157 aea98844234ea0dadca0bb089afa4d07f8f399b9 -- llvm/include/llvm-c/Core.h llvm/include/llvm/AsmParser/LLToken.h llvm/include/llvm/Bitcode/LLVMBitCodes.h llvm/include/llvm/IR/Constants.h llvm/lib/Analysis/ValueTracking.cpp llvm/lib/AsmParser/LLLexer.cpp llvm/lib/AsmParser/LLParser.cpp llvm/lib/Bitcode/Reader/BitcodeReader.cpp llvm/lib/Bitcode/Writer/BitcodeWriter.cpp llvm/lib/IR/AsmWriter.cpp llvm/lib/IR/ConstantFold.cpp llvm/lib/IR/Constants.cpp llvm/lib/IR/ConstantsContext.h llvm/lib/IR/LLVMContextImpl.h llvm/lib/IR/Verifier.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/include/llvm/Bitcode/LLVMBitCodes.h b/llvm/include/llvm/Bitcode/LLVMBitCodes.h
index 747bd55c2a..cd130cc666 100644
--- a/llvm/include/llvm/Bitcode/LLVMBitCodes.h
+++ b/llvm/include/llvm/Bitcode/LLVMBitCodes.h
@@ -403,16 +403,16 @@ enum ConstantsCodes {
   CST_CODE_CE_UNOP = 25,                   // CE_UNOP:      [opcode, opval]
   CST_CODE_POISON = 26,                    // POISON
   CST_CODE_DSO_LOCAL_EQUIVALENT = 27,      // DSO_LOCAL_EQUIVALENT [gvty, gv]
-  CST_CODE_INLINEASM_OLD3 = 28,    // INLINEASM:     [sideeffect|alignstack|
-                                   //                 asmdialect|unwind,
-                                   //                 asmstr,conststr]
-  CST_CODE_NO_CFI_VALUE = 29, // NO_CFI [ fty, f ]
-  CST_CODE_INLINEASM = 30,    // INLINEASM:     [fnty,
-                              //                 sideeffect|alignstack|
-                              //                 asmdialect|unwind,
-                              //                 asmstr,conststr]
-  CST_CODE_SIGNED_PTR = 31,   // CE_SIGNED_PTR: [ptrty, ptr, key,
-                              //                 addrdiscty, addrdisc, disc]
+  CST_CODE_INLINEASM_OLD3 = 28, // INLINEASM:     [sideeffect|alignstack|
+                                //                 asmdialect|unwind,
+                                //                 asmstr,conststr]
+  CST_CODE_NO_CFI_VALUE = 29,   // NO_CFI [ fty, f ]
+  CST_CODE_INLINEASM = 30,      // INLINEASM:     [fnty,
+                                //                 sideeffect|alignstack|
+                                //                 asmdialect|unwind,
+                                //                 asmstr,conststr]
+  CST_CODE_SIGNED_PTR = 31,     // CE_SIGNED_PTR: [ptrty, ptr, key,
+                                //                 addrdiscty, addrdisc, disc]
 };
 
 /// CastOpcodes - These are values used in the bitcode files to encode which
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 538200abcf..a68fd6d412 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -3617,10 +3617,10 @@ Error BitcodeReader::parseConstants() {
         return error("Invalid record");
 
       // PtrTy, Ptr, Key, AddrDiscTy, AddrDisc, Disc
-      V = BitcodeConstant::create(
-        Alloc, CurTy, BitcodeConstant::ConstantPtrAuthOpcode,
-        {(unsigned)Record[1], (unsigned)Record[2], (unsigned)Record[4],
-         (unsigned)Record[5]});
+      V = BitcodeConstant::create(Alloc, CurTy,
+                                  BitcodeConstant::ConstantPtrAuthOpcode,
+                                  {(unsigned)Record[1], (unsigned)Record[2],
+                                   (unsigned)Record[4], (unsigned)Record[5]});
 
       break;
     }

``````````

</details>


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


More information about the llvm-commits mailing list