I am trying to use Reaching Definition module, but I am not
able to get how to print the hashtables . I tried using ReachingDef.ppFdec fdec and also ReachingDef.getRDs sid in my code, after using ReachingDef.computeRDs fdec and preparing the CFG but it did not give any output even though it
compiled without any errors. I have included my program for reference. Is this the right way to do? Or should I add
something else? What would the ppFdec or getRDs return and how can I print it? If you could direct me to any program
which has used the Reaching Definition module for obtaining an output,
it would be really helpful.
Also, not all statements seem to have the sid (statement id). What is the chosen criterion
for a statement to have an id? Sometimes, the statement containing a
while or if condition seems to have more than one sid's, why is that so?
Thanking you in advance,
Sahana V P
Final Year B.Tech
Department of Computer Science and Engineering
National Institute of Technology Karnataka, Surathkal
From: Gabriel Kerneis <gabriel@ke...> - 2013-07-08 06:12:17
On Mon, Jul 08, 2013 at 01:20:51PM +0800, Sahana V P wrote:
> it did not give any output even though it compiled
> without any errors.
I have never used this module, but the reason why your program doesn't print
anything is because you "ignore(...)" the statements instead of printing them.
> List.iter(function (s:stmt)-> ignore(RD.getRDs s.sid))fdec.sallstmts;
E.log (RD.ppFdec fdec)
Or, if you want to print the output to some file:
let chan = open_out "rd.log" in
Pretty.fprint chan 80 (RD.ppFdec fdec);
since you do nothing about the children of your functions.
Get latest updates about Open Source Projects, Conferences and News.