diff options
author | Chris Lattner <sabre@nondot.org> | 2003-08-31 20:01:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-08-31 20:01:57 +0000 |
commit | 55b2eb3ef828819a623444ce966e70ad86ad6da4 (patch) | |
tree | 05b67c98e821654a5e36d0402b58a5be9ff45299 /include | |
parent | ff8fc078906da46b00aa102d724590b1b96e5526 (diff) | |
download | external_llvm-55b2eb3ef828819a623444ce966e70ad86ad6da4.zip external_llvm-55b2eb3ef828819a623444ce966e70ad86ad6da4.tar.gz external_llvm-55b2eb3ef828819a623444ce966e70ad86ad6da4.tar.bz2 |
Rename TarjanSCCIterator -> scc_iterator
* Increases consistency with other iterators (e.g. df_iterator, po_iterator...)
* It's shorter
* We don't name classes by the implementation, we name it for the interface!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8273 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/Support/SCCIterator.h | 37 | ||||
-rw-r--r-- | include/llvm/ADT/SCCIterator.h | 37 |
2 files changed, 36 insertions, 38 deletions
diff --git a/include/Support/SCCIterator.h b/include/Support/SCCIterator.h index 9daa6bd..e8c4af6 100644 --- a/include/Support/SCCIterator.h +++ b/include/Support/SCCIterator.h @@ -1,19 +1,18 @@ -//===-- Support/TarjanSCCIterator.h - Tarjan SCC iterator -------*- C++ -*-===// +//===-- Support/SCCIterator.h - SCC iterator --------------------*- C++ -*-===// // -// This builds on the Support/GraphTraits.h file to find the strongly -// connected components (SCCs) of a graph in O(N+E) time using -// Tarjan's DFS algorithm. +// This builds on the Support/GraphTraits.h file to find the strongly connected +// components (SCCs) of a graph in O(N+E) time using Tarjan's DFS algorithm. // -// The SCC iterator has the important property that if a node in SCC S1 -// has an edge to a node in SCC S2, then it visits S1 *after* S2. +// The SCC iterator has the important property that if a node in SCC S1 has an +// edge to a node in SCC S2, then it visits S1 *after* S2. // -// To visit S1 *before* S2, use the TarjanSCCIterator on the Inverse graph. +// To visit S1 *before* S2, use the scc_iterator on the Inverse graph. // (NOTE: This requires some simple wrappers and is not supported yet.) // //===----------------------------------------------------------------------===// -#ifndef SUPPORT_TARJANSCCITERATOR_H -#define SUPPORT_TARJANSCCITERATOR_H +#ifndef SUPPORT_SCCITERATOR_H +#define SUPPORT_SCCITERATOR_H #include "Support/GraphTraits.h" #include "Support/iterator" @@ -22,11 +21,11 @@ //===----------------------------------------------------------------------===// /// -/// TarjanSCC_iterator - Enumerate the SCCs of a directed graph, in +/// scc_iterator - Enumerate the SCCs of a directed graph, in /// reverse topological order of the SCC DAG. /// template<class GraphT, class GT = GraphTraits<GraphT> > -class TarjanSCC_iterator +class scc_iterator : public forward_iterator<std::vector<typename GT::NodeType>, ptrdiff_t> { typedef typename GT::NodeType NodeType; typedef typename GT::ChildIteratorType ChildItTy; @@ -122,14 +121,14 @@ class TarjanSCC_iterator } } - inline TarjanSCC_iterator(NodeType *entryN) : visitNum(0) { + inline scc_iterator(NodeType *entryN) : visitNum(0) { DFSVisitOne(entryN); GetNextSCC(); } - inline TarjanSCC_iterator() { /* End is when DFS stack is empty */ } + inline scc_iterator() { /* End is when DFS stack is empty */ } public: - typedef TarjanSCC_iterator<GraphT, GT> _Self; + typedef scc_iterator<GraphT, GT> _Self; // Provide static "constructors"... static inline _Self begin(GraphT& G) { return _Self(GT::getEntryNode(G)); } @@ -180,15 +179,15 @@ public: }; -// Global constructor for the Tarjan SCC iterator. +// Global constructor for the SCC iterator. template <class T> -TarjanSCC_iterator<T> tarj_begin(T G) { - return TarjanSCC_iterator<T>::begin(G); +scc_iterator<T> scc_begin(T G) { + return scc_iterator<T>::begin(G); } template <class T> -TarjanSCC_iterator<T> tarj_end(T G) { - return TarjanSCC_iterator<T>::end(G); +scc_iterator<T> scc_end(T G) { + return scc_iterator<T>::end(G); } #endif diff --git a/include/llvm/ADT/SCCIterator.h b/include/llvm/ADT/SCCIterator.h index 9daa6bd..e8c4af6 100644 --- a/include/llvm/ADT/SCCIterator.h +++ b/include/llvm/ADT/SCCIterator.h @@ -1,19 +1,18 @@ -//===-- Support/TarjanSCCIterator.h - Tarjan SCC iterator -------*- C++ -*-===// +//===-- Support/SCCIterator.h - SCC iterator --------------------*- C++ -*-===// // -// This builds on the Support/GraphTraits.h file to find the strongly -// connected components (SCCs) of a graph in O(N+E) time using -// Tarjan's DFS algorithm. +// This builds on the Support/GraphTraits.h file to find the strongly connected +// components (SCCs) of a graph in O(N+E) time using Tarjan's DFS algorithm. // -// The SCC iterator has the important property that if a node in SCC S1 -// has an edge to a node in SCC S2, then it visits S1 *after* S2. +// The SCC iterator has the important property that if a node in SCC S1 has an +// edge to a node in SCC S2, then it visits S1 *after* S2. // -// To visit S1 *before* S2, use the TarjanSCCIterator on the Inverse graph. +// To visit S1 *before* S2, use the scc_iterator on the Inverse graph. // (NOTE: This requires some simple wrappers and is not supported yet.) // //===----------------------------------------------------------------------===// -#ifndef SUPPORT_TARJANSCCITERATOR_H -#define SUPPORT_TARJANSCCITERATOR_H +#ifndef SUPPORT_SCCITERATOR_H +#define SUPPORT_SCCITERATOR_H #include "Support/GraphTraits.h" #include "Support/iterator" @@ -22,11 +21,11 @@ //===----------------------------------------------------------------------===// /// -/// TarjanSCC_iterator - Enumerate the SCCs of a directed graph, in +/// scc_iterator - Enumerate the SCCs of a directed graph, in /// reverse topological order of the SCC DAG. /// template<class GraphT, class GT = GraphTraits<GraphT> > -class TarjanSCC_iterator +class scc_iterator : public forward_iterator<std::vector<typename GT::NodeType>, ptrdiff_t> { typedef typename GT::NodeType NodeType; typedef typename GT::ChildIteratorType ChildItTy; @@ -122,14 +121,14 @@ class TarjanSCC_iterator } } - inline TarjanSCC_iterator(NodeType *entryN) : visitNum(0) { + inline scc_iterator(NodeType *entryN) : visitNum(0) { DFSVisitOne(entryN); GetNextSCC(); } - inline TarjanSCC_iterator() { /* End is when DFS stack is empty */ } + inline scc_iterator() { /* End is when DFS stack is empty */ } public: - typedef TarjanSCC_iterator<GraphT, GT> _Self; + typedef scc_iterator<GraphT, GT> _Self; // Provide static "constructors"... static inline _Self begin(GraphT& G) { return _Self(GT::getEntryNode(G)); } @@ -180,15 +179,15 @@ public: }; -// Global constructor for the Tarjan SCC iterator. +// Global constructor for the SCC iterator. template <class T> -TarjanSCC_iterator<T> tarj_begin(T G) { - return TarjanSCC_iterator<T>::begin(G); +scc_iterator<T> scc_begin(T G) { + return scc_iterator<T>::begin(G); } template <class T> -TarjanSCC_iterator<T> tarj_end(T G) { - return TarjanSCC_iterator<T>::end(G); +scc_iterator<T> scc_end(T G) { + return scc_iterator<T>::end(G); } #endif |