<div dir="ltr">Since i use the graph writing functionality a lot:<br><br><div>I presume you are talking about the usage of:<br><div> O << "\tNode" << static_cast<const void*>(Node) << " [shape=record,";</div><div><br></div></div><div>when you are talking about the pointer requirement.</div><div><br></div><div>The pointer part is not necessary. It is just giving unique names to nodes.</div><div><br></div><div>IE, the output looks like this:<br><div>digraph "Dominator tree for 'sink_store' function" {</div><div> <span class="" style="white-space:pre"> </span>label="Dominator tree for 'sink_store' function";</div><div><br></div><div> <span class="" style="white-space:pre"> </span>Node0x7fe900410e30 [shape=record,label="{entry}"];</div><div> <span class="" style="white-space:pre"> </span>Node0x7fe900410e30 -> Node0x7fe900410e60;</div><div> <span class="" style="white-space:pre"> </span>Node0x7fe900410e30 -> Node0x7fe900410e90;</div><div> <span class="" style="white-space:pre"> </span>Node0x7fe900410e30 -> Node0x7fe900410ec0;</div><div> <span class="" style="white-space:pre"> </span>Node0x7fe900410e60 [shape=record,label="{if.then}"];</div><div> <span class="" style="white-space:pre"> </span>Node0x7fe900410e90 [shape=record,label="{if.end}"];</div><div> <span class="" style="white-space:pre"> </span>Node0x7fe900410ec0 [shape=record,label="{if.else}"];</div><div>}</div></div><div><br></div><div><br></div><div>The node name itself is not important, only that it is unique and consistent.<br></div><div><br></div><div>For example, if graphtraits had an optional getUniqueNodeName that was implemented for things that wanted to be printed out as graphs, you could use that.</div><div><br></div><div>(sadly, uniquevector does not work with references, so you can't use it to solve this problem).</div><div><br></div><div>--Dan</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 16, 2016 at 8:42 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 a comment.<br>
<span class=""><br>
In <a href="https://reviews.llvm.org/D23580#517447" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>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>
</span>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>
<div class="HOEnZb"><div class="h5"><br>
<br>
<a href="https://reviews.llvm.org/D23580" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D23580</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>