Hello.
     I figured out what is the standard way of handling extra options for a CIL 
module.

     For example, the liveness.ml module contains as element of fd_extraopt:
        "--live_func",
        Arg.String (fun s -> live_func := s),
        " Output the variables live at each statement in this function.";
     To pass argument for the above specification, give, for example:
         bin/cilly --doLiveness --live_func=main app.c --save-temps
       (note the "=" sign; note that it's NOT working with "--live_func main").

   Best regards,
     Alex

On 9/20/2012 10:37 PM, Alex Susu wrote:
> Hello.
> I am trying to pass to the CIL executable (cilly.asm.exe) the following new 
> command line
> parameters that will be "routed" by main.ml to my CIL module:
> --myArg myString
> What is the best way of implementing this?
>
> In CIL_API.pdf it is mentioned:
> fd_extraopt : (string * Arg.spec * string) list ;
> Additional command line options. The description strings should usually start 
> with a space
> for Arg.align to print the -help nicely.
>
> However, I noticed that the Perl cilly driver transforms the command line 
> parameter list
> it passes to the CIL executable. For example, when giving:
> bin/cilly --docallgraph app.c --save-temps
> the driver calls:
> obj/x86_LINUX/cilly.asm.exe --out ./app.cil.c --docallgraph ./app.i
>
> I reversed engineered and worked on the Perl scripts cilly.pm and cilly 
> (subroutine
> collectOneArgument), but I am wondering: is this the natural way of doing 
> this? (there is
> also the option I could get myString from an input file, but this is less 
> desired).
>
> Thank you.
> Alex

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users

Reply via email to