[llvm] [LFI][AArch64] Add PAC support (PR #207915)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 7 00:32:43 PDT 2026


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 origin/main HEAD --extensions cpp,h -- llvm/include/llvm/MC/MCLFIRewriter.h llvm/lib/MC/MCStreamer.cpp llvm/lib/Target/AArch64/AArch64InstrInfo.cpp llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCLFIRewriter.cpp llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCLFIRewriter.h --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCLFIRewriter.cpp b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCLFIRewriter.cpp
index 3fce8cfa3..3899fba5f 100644
--- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCLFIRewriter.cpp
+++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCLFIRewriter.cpp
@@ -524,7 +524,7 @@ void AArch64MCLFIRewriter::rewriteAuthenticatedReturn(
     const MCInst &Inst, MCStreamer &Out, const MCSubtargetInfo &STI) {
   MCInst Auth;
   Auth.setOpcode(Inst.getOpcode() == AArch64::RETAA ? AArch64::AUTIASP
-                                                     : AArch64::AUTIBSP);
+                                                    : AArch64::AUTIBSP);
   emitInst(Auth, Out, STI);
 
   emitAddMask(AArch64::LR, AArch64::LR, Out, STI);
@@ -952,9 +952,8 @@ void AArch64MCLFIRewriter::doRewriteInst(const MCInst &Inst, MCStreamer &Out,
 
   // Flush a deferred LR guard before any control-flow instruction, so that a
   // modified LR is sandboxed before it can be used to transfer control.
-  if (DeferredLRGuard &&
-      (isReturn(Inst) || isIndirectBranch(Inst) || isCall(Inst) ||
-       isBranch(Inst))) {
+  if (DeferredLRGuard && (isReturn(Inst) || isIndirectBranch(Inst) ||
+                          isCall(Inst) || isBranch(Inst))) {
     emitAddMask(AArch64::LR, AArch64::LR, Out, STI);
     DeferredLRGuard = false;
   }

``````````

</details>


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


More information about the llvm-commits mailing list