[llvm] [IR] Don't allow successors() over block without terminators (PR #186646)

via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 15 01:15:45 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 h,cpp -- llvm/include/llvm/IR/CFG.h llvm/lib/FuzzMutate/RandomIRBuilder.cpp llvm/lib/IR/Verifier.cpp llvm/lib/Transforms/Utils/BasicBlockUtils.cpp llvm/unittests/Analysis/BasicAliasAnalysisTest.cpp llvm/unittests/Analysis/DomTreeUpdaterTest.cpp llvm/unittests/Analysis/MemorySSATest.cpp llvm/unittests/Transforms/Utils/SSAUpdaterBulkTest.cpp --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/include/llvm/IR/CFG.h b/llvm/include/llvm/IR/CFG.h
index e8158fdc2..c68c2f2e5 100644
--- a/llvm/include/llvm/IR/CFG.h
+++ b/llvm/include/llvm/IR/CFG.h
@@ -146,9 +146,7 @@ inline succ_iterator succ_begin(Instruction *I) {
 inline const_succ_iterator succ_begin(const Instruction *I) {
   return I->successors().begin();
 }
-inline succ_iterator succ_end(Instruction *I) {
-  return I->successors().end();
-}
+inline succ_iterator succ_end(Instruction *I) { return I->successors().end(); }
 inline const_succ_iterator succ_end(const Instruction *I) {
   return I->successors().end();
 }
@@ -158,9 +156,7 @@ inline bool succ_empty(const Instruction *I) {
 inline unsigned succ_size(const Instruction *I) {
   return std::distance(succ_begin(I), succ_end(I));
 }
-inline succ_range successors(Instruction *I) {
-  return I->successors();
-}
+inline succ_range successors(Instruction *I) { return I->successors(); }
 inline const_succ_range successors(const Instruction *I) {
   return I->successors();
 }

``````````

</details>


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


More information about the llvm-commits mailing list