[llvm] [ObjCARC] Change autorelease to release when the pool state is not changed between the autorelease and the pool pop (PR #152353)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 18 11:58:48 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 origin/main HEAD --extensions cpp -- llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
``````````

: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/Transforms/ObjCARC/ObjCARCOpts.cpp b/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
index 0fbc4997e..a6d3da3b0 100644
--- a/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
+++ b/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
@@ -148,10 +148,10 @@ static bool HasFollowingAutoreleasePoolPop(Instruction *AutoreleaseInst) {
       // Unknown call could affect autorelease pool state or return autoreleased
       // objects
       return false;
-  }
+    }
 
-  // Reached end of basic block without finding a pool pop
-  return false;
+    // Reached end of basic block without finding a pool pop
+    return false;
 }
 
 // TODO: On code like this:

``````````

</details>


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


More information about the llvm-commits mailing list