Re: QC-- Graphical Control Flow Graph

Norman Ramsey <[email protected]>
Newsgroups gmane.comp.lang.c--
Message-ID <[email protected]>
 > I am having trouble extracting the CFG in DOT format.
 > I see the functions Cfgutil.cfg2dot and Stages.writedot (defined in  
 > lualink.nw), but I
 > have not been successfull in calling them.

Sorry, you tripped over a couple of bugs we introduced along with the
new flow graph.  In the brave new world, it's not so easy for us to
print liveness information.

I've committed changes and tested as follows:

 ./qc-- backend.improve=Optimize.improve -e 'tinsert(backend.phases, Util.indexof(backend.phases, "rmvfp")+1, Stages.writedot)' -S hello.c-- 2> /tmp/x.dot

This should hit the repository tonight and be a useful guide to
inserting extra stages in useful places.  Meanwhile, until these
changes hit the server, here is a patch that may be useful.


Norman

: nr@toller 10444 ; cvs diff -D06/18/2005 src/cfgutil.nw src/lualink.nw
Index: src/cfgutil.nw
===================================================================
RCS file: /home/lair/nr/repositories/c--/qc--/src/cfgutil.nw,v
retrieving revision 1.48
retrieving revision 1.49
diff -r1.48 -r1.49
151a152,154
>     let is_next (u', _) = match next with
>     | Some (u, _) -> Unique.eq u u'
>     | None -> false in
154c157
<     | GR.Last (GR.Branch (_, lbl)) when next =*= Some lbl -> (i, nodes') 
---
>     | GR.Last (GR.Branch (_, lbl)) when is_next lbl -> (i, nodes') 
Index: src/lualink.nw
===================================================================
RCS file: /home/lair/nr/repositories/c--/qc--/src/lualink.nw,v
retrieving revision 1.155
retrieving revision 1.156
diff -r1.155 -r1.156
689c689
<           (Cfgutil.cfg2dot ~compress:true ~live:true
---
>           (Cfgutil.cfg2dot ~compress:true ~live:false
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.