caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* issues on modifying code in ext/cfg.ml in CIL
@ 2010-07-21  2:59 haihao shen
  2010-07-21  6:36 ` [Caml-list] " Gabriel Kerneis
  0 siblings, 1 reply; 3+ messages in thread
From: haihao shen @ 2010-07-21  2:59 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 1183 bytes --]

Hi all,

Currently I am doing some work on CIL. I would like to obtain the
conditional result (true/false) in the DOT file generated by CIL. Therefore,
I modified the code in ext/cfg.ml.

let d_cfgedge (src) () (dest) =
    match src.skind with
      | If (_, tb, fb, _) ->
   (if (List.mem dest tb.bstmts) then
      dprintf "%a -> %a [label=\"true\"]"
             d_cfgnodename src
             d_cfgnodename dest
    else if (List.mem dest fb.bstmts) then
      dprintf "%a -> %a [label=\"false\"]"
             d_cfgnodename src
             d_cfgnodename dest
    else
      dprintf "%a -> %a [label=\"true$\"]"(*true likely, note that no false
likely!!!*)
             d_cfgnodename src
             d_cfgnodename dest);
      | _ -> dprintf "%a -> %a"
        d_cfgnodename src
        d_cfgnodename dest

However, I am wondering whether my solution is correct becuase there is no
related document explaining this issue. In particularly, in my real cases, I
found the highlighted case is also hit. I am also wondering whether there
are other cases that I don't consider here.

Look forward to your reply. Any concern or feedback would be greatly
appreciated.

Thanks,
Haihao

[-- Attachment #2: Type: text/html, Size: 1560 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-21  6:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-21  2:59 issues on modifying code in ext/cfg.ml in CIL haihao shen
2010-07-21  6:36 ` [Caml-list] " Gabriel Kerneis
2010-07-21  6:55   ` haihao shen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).