[llvm] StackProtector: use isInTailCallPosition to verify tail call position (PR #68997)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 13 08:23:25 PDT 2023


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 ba79fb2e1ff7130cde02fbbd325f0f96f8a522ca 8ffcb7fe0043337c14bf5e4dafb08db5dd4bfdb8 -- 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 8204425a3509..0a938da54195 100644
--- a/llvm/lib/CodeGen/StackProtector.cpp
+++ b/llvm/lib/CodeGen/StackProtector.cpp
@@ -523,8 +523,7 @@ bool StackProtector::InsertStackProtectors() {
     // If we're instrumenting a block with a tail call, the check has to be
     // inserted before the call rather than between it and the return.
     Instruction *Prev = CheckLoc->getPrevNonDebugInstruction();
-    if (Prev && isa<CallInst>(Prev) &&
-        cast<CallInst>(Prev)->isTailCall() &&
+    if (Prev && isa<CallInst>(Prev) && cast<CallInst>(Prev)->isTailCall() &&
         isInTailCallPosition(*cast<CallInst>(Prev), *TM)) {
       CheckLoc = Prev;
     }

``````````

</details>


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


More information about the llvm-commits mailing list