<div dir="ltr">Looks fine to me.<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 30, 2018 at 11:34 AM, Easwaran Raman via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">eraman created this revision.<br>
eraman added reviewers: dberlin, davidxl.<br>
<br>
This change is mostly adding comments to GraphTraits describing<br>
interfaces to iterate over children edges of a node. These will<br>
have to be implemented by specializations of GraphTraits. The<br>
non-comment change is the addition of children_edges template<br>
function that returns an iterator range.<br>
<br>
The motivation for this is to use it in synthetic count propagation<br>
algorithm and remove the CallGraphTraits class that provide similar<br>
interfaces.<br>
<br>
<br>
Repository:<br>
rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D42698" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D42698</a><br>
<br>
Files:<br>
include/llvm/ADT/GraphTraits.h<br>
<br>
<br>
Index: include/llvm/ADT/GraphTraits.h<br>
==============================<wbr>==============================<wbr>=======<br>
--- include/llvm/ADT/GraphTraits.h<br>
+++ include/llvm/ADT/GraphTraits.h<br>
@@ -47,6 +47,19 @@<br>
// static nodes_iterator nodes_end (GraphType *G)<br>
// nodes_iterator/begin/end - Allow iteration over all nodes in the graph<br>
<br>
+ // typedef EdgeRef - Type of Edge token in the graph, which should<br>
+ // be cheap to copy.<br>
+ // typedef ChildEdgeIteratorType - Type used to iterate over children edges in<br>
+ // graph, dereference to a EdgeRef.<br>
+<br>
+ // static ChildEdgeIteratorType child_edge_begin(NodeRef)<br>
+ // static ChildEdgeIteratorType child_edge_end(NodeRef)<br>
+ // Return iterators that point to the beginning and ending of the<br>
+ // edge list for the given callgraph node.<br>
+ //<br>
+ // static NodeRef edge_dest(EdgeRef)<br>
+ // Return the destination node of an edge.<br>
+<br>
// static unsigned size (GraphType *G)<br>
// Return total number of nodes in the graph<br>
<br>
@@ -111,6 +124,13 @@<br>
GraphTraits<Inverse<GraphType><wbr>>::child_end(G));<br>
}<br>
<br>
+template <class GraphType><br>
+iterator_range<typename GraphTraits<GraphType>::<wbr>ChildEdgeIteratorType><br>
+children_edges(const typename GraphTraits<GraphType>::<wbr>NodeRef &G) {<br>
+ return make_range(GraphTraits<<wbr>GraphType>::child_edge_begin(<wbr>G),<br>
+ GraphTraits<GraphType>::child_<wbr>edge_end(G));<br>
+}<br>
+<br>
} // end namespace llvm<br>
<br>
#endif // LLVM_ADT_GRAPHTRAITS_H<br>
<br>
<br>
</blockquote></div><br></div>