From 7f74a56e2436c40b18a672ad7d58727cd6832329 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 20 Jan 2002 22:54:45 +0000 Subject: Changes to build successfully with GCC 3.02 llvm-svn: 1503 --- llvm/include/Support/DepthFirstIterator.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'llvm/include/Support/DepthFirstIterator.h') diff --git a/llvm/include/Support/DepthFirstIterator.h b/llvm/include/Support/DepthFirstIterator.h index a2d5a9df68c..2961497adc3 100644 --- a/llvm/include/Support/DepthFirstIterator.h +++ b/llvm/include/Support/DepthFirstIterator.h @@ -20,21 +20,21 @@ class df_iterator : public std::forward_iterator Visited; // All of the blocks visited so far... + std::set Visited; // All of the blocks visited so far... // VisitStack - Used to maintain the ordering. Top = current block // First element is node pointer, second is the 'next child' to visit - stack > VisitStack; + std::stack > VisitStack; const bool Reverse; // Iterate over children before self? private: void reverseEnterNode() { - pair &Top = VisitStack.top(); + std::pair &Top = VisitStack.top(); NodeType *Node = Top.first; ChildItTy &It = Top.second; for (; It != GT::child_end(Node); ++It) { NodeType *Child = *It; if (!Visited.count(Child)) { Visited.insert(Child); - VisitStack.push(make_pair(Child, GT::child_begin(Child))); + VisitStack.push(std::make_pair(Child, GT::child_begin(Child))); reverseEnterNode(); return; } @@ -43,7 +43,7 @@ private: inline df_iterator(NodeType *Node, bool reverse) : Reverse(reverse) { Visited.insert(Node); - VisitStack.push(make_pair(Node, GT::child_begin(Node))); + VisitStack.push(std::make_pair(Node, GT::child_begin(Node))); if (Reverse) reverseEnterNode(); } inline df_iterator() { /* End is when stack is empty */ } @@ -81,7 +81,7 @@ public: reverseEnterNode(); } else { // Normal Depth First Iterator do { - pair &Top = VisitStack.top(); + std::pair &Top = VisitStack.top(); NodeType *Node = Top.first; ChildItTy &It = Top.second; @@ -90,7 +90,7 @@ public: if (!Visited.count(Next)) { // Has our next sibling been visited? // No, do it now. Visited.insert(Next); - VisitStack.push(make_pair(Next, GT::child_begin(Next))); + VisitStack.push(std::make_pair(Next, GT::child_begin(Next))); return *this; } } -- cgit v1.2.3