summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2004-01-20 17:49:42 +0000
committerTanya Lattner <tonic@nondot.org>2004-01-20 17:49:42 +0000
commit72494e04be1d7a0ab92f457dee5606b60c9dd09b (patch)
tree3d53e713da2fe7c4f2af24fe95f9c2a499e087f5 /llvm/lib
parent6cc66d93f1d0a1b043f5dc184569bfb84cb60090 (diff)
downloadbcm5719-llvm-72494e04be1d7a0ab92f457dee5606b60c9dd09b.tar.gz
bcm5719-llvm-72494e04be1d7a0ab92f457dee5606b60c9dd09b.zip
Moved iterators to common file.
llvm-svn: 10925
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/InstrSched/SchedGraph.h62
1 files changed, 0 insertions, 62 deletions
diff --git a/llvm/lib/CodeGen/InstrSched/SchedGraph.h b/llvm/lib/CodeGen/InstrSched/SchedGraph.h
index 5aee9b25f69..18b2a3f8842 100644
--- a/llvm/lib/CodeGen/InstrSched/SchedGraph.h
+++ b/llvm/lib/CodeGen/InstrSched/SchedGraph.h
@@ -180,68 +180,6 @@ public:
-//********************** Sched Graph Iterators *****************************/
-
-// Ok to make it a template because it shd get instantiated at most twice:
-// for <SchedGraphNode, SchedGraphNode::iterator> and
-// for <const SchedGraphNode, SchedGraphNode::const_iterator>.
-//
-template <class _NodeType, class _EdgeType, class _EdgeIter>
-class SGPredIterator: public bidirectional_iterator<_NodeType, ptrdiff_t> {
-protected:
- _EdgeIter oi;
-public:
- typedef SGPredIterator<_NodeType, _EdgeType, _EdgeIter> _Self;
-
- inline SGPredIterator(_EdgeIter startEdge) : oi(startEdge) {}
-
- inline bool operator==(const _Self& x) const { return oi == x.oi; }
- inline bool operator!=(const _Self& x) const { return !operator==(x); }
-
- // operator*() differs for pred or succ iterator
- inline _NodeType* operator*() const { return (_NodeType*)(*oi)->getSrc(); }
- inline _NodeType* operator->() const { return operator*(); }
-
- inline _EdgeType* getEdge() const { return *(oi); }
-
- inline _Self &operator++() { ++oi; return *this; } // Preincrement
- inline _Self operator++(int) { // Postincrement
- _Self tmp(*this); ++*this; return tmp;
- }
-
- inline _Self &operator--() { --oi; return *this; } // Predecrement
- inline _Self operator--(int) { // Postdecrement
- _Self tmp = *this; --*this; return tmp;
- }
-};
-
-template <class _NodeType, class _EdgeType, class _EdgeIter>
-class SGSuccIterator : public bidirectional_iterator<_NodeType, ptrdiff_t> {
-protected:
- _EdgeIter oi;
-public:
- typedef SGSuccIterator<_NodeType, _EdgeType, _EdgeIter> _Self;
-
- inline SGSuccIterator(_EdgeIter startEdge) : oi(startEdge) {}
-
- inline bool operator==(const _Self& x) const { return oi == x.oi; }
- inline bool operator!=(const _Self& x) const { return !operator==(x); }
-
- inline _NodeType* operator*() const { return (_NodeType*)(*oi)->getSink(); }
- inline _NodeType* operator->() const { return operator*(); }
-
- inline _EdgeType* getEdge() const { return *(oi); }
-
- inline _Self &operator++() { ++oi; return *this; } // Preincrement
- inline _Self operator++(int) { // Postincrement
- _Self tmp(*this); ++*this; return tmp;
- }
-
- inline _Self &operator--() { --oi; return *this; } // Predecrement
- inline _Self operator--(int) { // Postdecrement
- _Self tmp = *this; --*this; return tmp;
- }
-};
//
// sg_pred_iterator
OpenPOWER on IntegriCloud