<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 16, 2016 at 8:42 PM Tim Shen <<a href="mailto:timshen@google.com">timshen@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">timshen added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D23580#517447" rel="noreferrer" target="_blank">https://reviews.llvm.org/D23580#517447</a>, @dblaikie wrote:<br>
<br>
> what's the printer used for? Would it be best to generalize it (perhaps adding another extension point to the graph traits, so NodeRefs can be printed out - with a default implementation for pointers)?<br>
<br>
<br>
One usage is to print dot files.<br>
<br>
I think it's more like that GraphWriter that requires the input nodes to be both fulfilling GraphTraits, and printable, not that GraphTraits has an optional printable requirement - these are two totally orthogonal traits.<br></blockquote><div><br></div><div>Fair - though I'm not sure if it's too important whether that's expressed through graph traits or not. I guess maybe it's easier if it's separate.<br><br>But, for example, for the heavy references you wanted to implement (that motivated all this refactoring) which, if I understand, are something like {node number, graph reference} - printing that out would be as simple as printing the node number. (or, if you wanted to be able to print multiple graphs and know they are distinct, it could print both elements of the heavy reference)<br><br>Is there just the one graph algorithm that requires print support? If it's just one, I can understand not bothering to introduce another trait, etc (especially if only raw pointers are used with the one printing graph algorithm)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<a href="https://reviews.llvm.org/D23580" rel="noreferrer" target="_blank">https://reviews.llvm.org/D23580</a><br>
<br>
<br>
<br>
</blockquote></div></div>