aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/PostOrderIterator.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/ADT/PostOrderIterator.h')
-rw-r--r--include/llvm/ADT/PostOrderIterator.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/llvm/ADT/PostOrderIterator.h b/include/llvm/ADT/PostOrderIterator.h
index dd8cc74..dfadc3b 100644
--- a/include/llvm/ADT/PostOrderIterator.h
+++ b/include/llvm/ADT/PostOrderIterator.h
@@ -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>