Re-sort #include lines using my handy dandy ./utils/sort_includes.py
[oota-llvm.git] / include / llvm / ADT / PostOrderIterator.h
index 7f6350e4443e1567cc712b1e8b6d872bd9bb207a..dfadc3b85db6d6fae7e3a355f3936a8c328d0882 100644 (file)
@@ -57,7 +57,7 @@ public:
   // Return true if edge destination should be visited.
   template<typename NodeType>
   bool insertEdge(NodeType *From, NodeType *To) {
-    return Visited.insert(To);
+    return Visited.insert(To).second;
   }
 
   // Called after all children of BB have been visited.
@@ -76,8 +76,9 @@ public:
   // Return true if edge destination should be visited, called with From = 0 for
   // the root node.
   // Graph edges can be pruned by specializing this function.
-  template<class NodeType>
-  bool insertEdge(NodeType *From, NodeType *To) { return Visited.insert(To); }
+  template <class NodeType> bool insertEdge(NodeType *From, NodeType *To) {
+    return Visited.insert(To).second;
+  }
 
   // Called after all children of BB have been visited.
   template<class NodeType>
@@ -111,7 +112,7 @@ class po_iterator : public std::iterator<std::forward_iterator_tag,
   }
 
   inline po_iterator(NodeType *BB) {
-    this->insertEdge((NodeType*)0, BB);
+    this->insertEdge((NodeType*)nullptr, BB);
     VisitStack.push_back(std::make_pair(BB, GT::child_begin(BB)));
     traverseChild();
   }
@@ -119,7 +120,7 @@ class po_iterator : public std::iterator<std::forward_iterator_tag,
 
   inline po_iterator(NodeType *BB, SetType &S) :
     po_iterator_storage<SetType, ExtStorage>(S) {
-    if (this->insertEdge((NodeType*)0, BB)) {
+    if (this->insertEdge((NodeType*)nullptr, BB)) {
       VisitStack.push_back(std::make_pair(BB, GT::child_begin(BB)));
       traverseChild();
     }
@@ -260,7 +261,7 @@ class ReversePostOrderTraversal {
   typedef typename GT::NodeType NodeType;
   std::vector<NodeType*> Blocks;       // Block list in normal PO order
   inline void Initialize(NodeType *BB) {
-    copy(po_begin(BB), po_end(BB), back_inserter(Blocks));
+    std::copy(po_begin(BB), po_end(BB), std::back_inserter(Blocks));
   }
 public:
   typedef typename std::vector<NodeType*>::reverse_iterator rpo_iterator;