[LLVMdev] DOTGraphTraits and GraphWriter

Dan Gohman gohman at apple.com
Tue Sep 16 12:59:17 PDT 2008


Hello Prakash,

The SelectionDAG viewers (llc -view-isel-dags etc.) support
both multiple edges between the same pair of nodes, and labels
at least for each incoming edge. See
lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp for code you
might use as an example, though it is a bit tricky.

Dan

On Sep 15, 2008, at 3:15 PM, Prakash Prabhu wrote:

> Hi all,
>
> I have two questions related to .dot graph output. Basically, I have a
> graph representing a program dependence graph like structure with
> (a) multiple edges between the same pair of nodes
> (b) each edge having a special (different) text/label
>
> I implemented a template-specialized version of DotGraphTraits for the
> my graph structure which given a node, uses a map_iterator (similar to
> the one used in CallGraph) to get the destination node of an outgoing
> edge. This works fine except that I have no clue how to support (a)
> and (b) since once the destination node is returned I lose access to
> the edge and cannot do any text annotation onto an edge of the graph.
>
> Is there some other way to achieve (a) and (b) without having to
> implement my own special version of GraphWriter ?
>
> thanks,
> Prakash
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list