Hi,

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,

Sincerely 

Sahana V P
Final Year B.Tech 
Department of Computer Science and Engineering
National Institute of Technology Karnataka, Surathkal
India-575025
open Cil
open Pretty

module IR = Simplify
module LIVE = Liveness
module VS = Usedef.VS
module DF = Dataflow
module RD = Reachingdefs
module IH = Inthash


class printVisitor =
	object inherit nopCilVisitor
 	
	 method vfunc fdec=
		RD.debug :=true;
                Cil.prepareCFG fdec;
                Cil.computeCFGInfo fdec true;
		RD.computeRDs fdec;
		RD.ppFdec fdec;
		List.iter(function (s:stmt)-> ignore(RD.getRDs s.sid))fdec.sallstmts;
	DoChildren       	
	

	
end



let printFunc =
	function (f: file) -> 
		visitCilFile (new printVisitor) f

let feature: featureDescr = 
{
	fd_name = "reachingdefn";
	fd_enabled = ref false;
	fd_description = "reaching defition of the program";
	fd_extraopt = [];
	fd_doit = printFunc;
        fd_post_check = false
}
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users

Reply via email to