[LLVMdev] DOTGraphTraits and GraphWriter

Prakash Prabhu prakash.prabhu at gmail.com
Tue Sep 16 14:58:59 PDT 2008


Hi Dan,

Thanks for the reply. I got the labels for each outgoing edge (at the
source node's 'structure' field) working. Is there a way to find out
the outgoing edge number from EdgeIter. (Basically the Node in my
graph has a a bunch of outgoing edges, so that I can just index into
that collection within the node to get the appropriate edges'
attributes).

regards,
Prakash

On Tue, Sep 16, 2008 at 3:59 PM, Dan Gohman <gohman at apple.com> wrote:
> 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
>
> _______________________________________________
> 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