[llvm] [CodeGen][ARM] Bug fix InsertStackProtectors with EH_SJ_LJ (PR #147411)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 7 15:05:49 PDT 2025


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 HEAD~1 HEAD --extensions cpp -- llvm/lib/CodeGen/StackProtector.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/CodeGen/StackProtector.cpp b/llvm/lib/CodeGen/StackProtector.cpp
index a2bc69ef5..e31083702 100644
--- a/llvm/lib/CodeGen/StackProtector.cpp
+++ b/llvm/lib/CodeGen/StackProtector.cpp
@@ -589,13 +589,13 @@ bool InsertStackProtectors(const TargetMachine *TM, Function *F,
     Instruction *CheckLoc = dyn_cast<ReturnInst>(BB.getTerminator());
     if (!CheckLoc && !DisableCheckNoReturn)
       for (auto &Inst : BB) {
-        if(auto *IB = dyn_cast<IntrinsicInst>(&Inst) )
-           if(IB->getIntrinsicID()==Intrinsic::eh_sjlj_callsite) {
-              // eh_sjlj_callsite has to be in same BB as the
-              // bb terminator. Dont insert within this range.
-              CheckLoc = IB;
-              break;
-           }
+        if (auto *IB = dyn_cast<IntrinsicInst>(&Inst))
+          if (IB->getIntrinsicID() == Intrinsic::eh_sjlj_callsite) {
+            // eh_sjlj_callsite has to be in same BB as the
+            // bb terminator. Dont insert within this range.
+            CheckLoc = IB;
+            break;
+          }
         if (auto *CB = dyn_cast<CallBase>(&Inst))
           // Do stack check before noreturn calls that aren't nounwind (e.g:
           // __cxa_throw).

``````````

</details>


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


More information about the llvm-commits mailing list