Re: [CIL users] CIL homepage down?

2010-04-08 Thread Gabriel Kerneis
On Wed, Mar 24, 2010 at 09:57:06PM -0400, Vinai Sundaram wrote: > I have problems accessing the homepage at > http://hal.cs.berkeley.edu/cil/ > Has the homepage moved to a different location or the web server is down? Still down. The svn works fine, though. Any hint? -- Gabriel Kerneis ---

Re: [CIL users] BUG in Cil with Switch/Case ?

2010-04-08 Thread David Gay
On Thu, Apr 8, 2010 at 9:18 AM, ThanhVu (Vu) Nguyen wrote: >> >> >> It depends on the semantics you expect, but my rule of thumb is: >> >> 1) NEVER use ChangeTo (or its ChangeDoChildrenPost counterpart) in >>   vstmt (unless you return the same statement of course). >> 2) If you really feel the ne

Re: [CIL users] BUG in Cil with Switch/Case ?

2010-04-08 Thread ThanhVu (Vu) Nguyen
> > > > It depends on the semantics you expect, but my rule of thumb is: > > 1) NEVER use ChangeTo (or its ChangeDoChildrenPost counterpart) in > vstmt (unless you return the same statement of course). > 2) If you really feel the need to use it, think twice and goto rule 1. > If I need to instr

Re: [CIL users] BUG in Cil with Switch/Case ?

2010-04-08 Thread Gabriel Kerneis
On Thu, Apr 08, 2010 at 09:38:35AM -0600, ThanhVu (Vu) Nguyen wrote: > Gabriel, Thanks for the quick response . Is there any benefits or side > effects if I use inplace modification like in your example ? Yes. Imagine you have the following code: l: if(foo) { bar; } goto l; My code would prod

Re: [CIL users] BUG in Cil with Switch/Case ?

2010-04-08 Thread ThanhVu (Vu) Nguyen
Gabriel, Thanks for the quick response . Is there any benefits or side effects if I use inplace modification like in your example ? VN - On Thu, Apr 8, 2010 at 9:17 AM, Gabriel Kerneis wrote: > Hi, > > On Thu, Apr 08, 2010 at 08:46:22AM -0600, ThanhVu (Vu) Nguyen wrote: > > Is this a bug in C

Re: [CIL users] BUG in Cil with Switch/Case ?

2010-04-08 Thread ThanhVu (Vu) Nguyen
Thanks for these quick responses ! VN - On Thu, Apr 8, 2010 at 9:19 AM, Elnatan Reisner wrote: > On Apr 8, 2010, at 10:46 AM, ThanhVu (Vu) Nguyen wrote: > > let's say I want to add a statement s1 (e.g., printf("hello world");) > before every IF in the code. I created an instrumenter with

Re: [CIL users] BUG in Cil with Switch/Case ?

2010-04-08 Thread Elnatan Reisner
On Apr 8, 2010, at 10:46 AM, ThanhVu (Vu) Nguyen wrote: let's say I want to add a statement s1 (e.g., printf("hello world");) before every IF in the code. I created an instrumenter with CIL that basically does mkStmt(Block(mkBlock([s1 ; if_stuff]))) . It works out well in most case exce

Re: [CIL users] BUG in Cil with Switch/Case ?

2010-04-08 Thread Gabriel Kerneis
Hi, On Thu, Apr 08, 2010 at 08:46:22AM -0600, ThanhVu (Vu) Nguyen wrote: > Is this a bug in CIL or there's some other way to do what I want ?TIA Statement cases are labels. You have to copy them as well if you want them to be in the right place (or modify the statement in place, see below):

[CIL users] BUG in Cil with Switch/Case ?

2010-04-08 Thread ThanhVu (Vu) Nguyen
I've been using CIL to do some instrumentations and discovered this unexpected bug -- let's say I want to add a statement s1 (e.g., printf("hello world");) before every IF in the code. I created an instrumenter with CIL that basically does mkStmt(Block(mkBlock([s1 ; if_stuff]))) . It works o

Re: [CIL users] removing the #line , clearer code output

2010-04-08 Thread Gabriel Kerneis
Hi, On Wed, Apr 07, 2010 at 06:06:16PM -0600, ThanhVu (Vu) Nguyen wrote: > can I tell CIL to process/output the code without adding the #line X ? --noPrintLn Do not output #line directives in the output --commPrintLn Print #line directives in the output, but put