[llvm] SCC iterator for general graph (PR #84268)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 6 17:37:44 PST 2024
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 318bff6811e7a7e0d3295ed85aa3ad01d475cc8c 11489913facb5c8362c16bf78766ce33db65fcfa -- llvm/include/llvm/ADT/SCCIterator.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm/ADT/SCCIterator.h b/llvm/include/llvm/ADT/SCCIterator.h
index 0c25323f32..f764d4d0c0 100644
--- a/llvm/include/llvm/ADT/SCCIterator.h
+++ b/llvm/include/llvm/ADT/SCCIterator.h
@@ -379,9 +379,10 @@ scc_member_iterator<GraphT, GT>::scc_member_iterator(
}
template <class GraphT, class GT = GraphTraits<GraphT>>
-class graph_scc_iterator : public iterator_facade_base<
- graph_scc_iterator<GraphT, GT>, std::forward_iterator_tag,
- const std::vector<typename GT::NodeRef>, ptrdiff_t> {
+class graph_scc_iterator
+ : public iterator_facade_base<
+ graph_scc_iterator<GraphT, GT>, std::forward_iterator_tag,
+ const std::vector<typename GT::NodeRef>, ptrdiff_t> {
using NodeRef = typename GT::NodeRef;
using NodesIter = typename GT::nodes_iterator;
using ChildIter = typename GT::ChildIteratorType;
@@ -426,7 +427,8 @@ class graph_scc_iterator : public iterator_facade_base<
for (; currentNode != nodeEndIter; currentNode++) {
NodeRef v = *currentNode;
if (nodeInfo[v].index == 0) {
- recursionStack.emplace(StackEntry{v, GT::child_begin(v), nullptr, false});
+ recursionStack.emplace(
+ StackEntry{v, GT::child_begin(v), nullptr, false});
currentNode++;
break;
}
@@ -448,7 +450,8 @@ class graph_scc_iterator : public iterator_facade_base<
stackEntry.visited = true;
} else {
assert(nodeInfo.count(stackEntry.lastChild));
- vEntry.lowlink = std::min(vEntry.lowlink, nodeInfo[stackEntry.lastChild].lowlink);
+ vEntry.lowlink =
+ std::min(vEntry.lowlink, nodeInfo[stackEntry.lastChild].lowlink);
}
bool inserted = false;
@@ -457,7 +460,8 @@ class graph_scc_iterator : public iterator_facade_base<
NodeEntry &wEntry = nodeInfo[w];
if (wEntry.index == 0) {
inserted = true;
- recursionStack.emplace(StackEntry{w, GT::child_begin(w), nullptr, false});
+ recursionStack.emplace(
+ StackEntry{w, GT::child_begin(w), nullptr, false});
stackEntry.lastChild = w;
child++;
break;
``````````
</details>
https://github.com/llvm/llvm-project/pull/84268
More information about the llvm-commits
mailing list