<div dir="ltr">FWIW: TreeTraits would be very nice.<br><div><br></div><div>For example, the depth first iterator always stores a visited set, and for trees like the dominator tree, this is a complete waste of time and memory.</div><div><br></div><div>It'd be nice to specialize it for trees.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 17, 2016 at 10:56 PM, Tim Shen via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">timshen added inline comments.<br>
<span class=""><br>
================<br>
Comment at: include/llvm/Analysis/<wbr>RegionIterator.h:35<br>
@@ -34,3 @@<br>
-class RNSuccIterator : public std::iterator<std::forward_<wbr>iterator_tag,<br>
-                                           NodeType, ptrdiff_t> {<br>
-  typedef std::iterator<std::forward_<wbr>iterator_tag, NodeType, ptrdiff_t> super;<br>
----------------<br>
</span><span class="">dblaikie wrote:<br>
> If it has to be a pointer type anyway - would it be simpler to preserve that behavior of value_type being a pointer rather than a value? Or is there something else going on here as well that makes this change necessary/useful?<br>
</span>Actually by looking at the code, I can tell that NodeType is always GraphTraits<BlockT*>::<wbr>NodeType. After the migration I prefer to keep the consistency, that is the template parameter NodeRef is always GraphTraits<BlockT*>::NodeRef. The fact that NodeRef is required to be a pointer seems not worthy to be mentioned too frequently.<br>
<br>
The code also assumes that BlockT* is NodeRef/NodeType*. And the code also uses getParent(). I'm sad that people stick on GraphTraits just because it exists, when TreeTraits could be a better fit.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<a href="https://reviews.llvm.org/D23625" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D23625</a><br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>