Re: [CIL users] changing name of functions

2009-12-17 Thread Gabriel Kerneis
Hi, On Thu, Dec 17, 2009 at 03:46:32PM -0700, ThanhVu (Vu) Nguyen wrote: > 1)  After I change the original statement s to a new one s'  , I want > s'.id  to be the same as s.id.  Using the   "method vinst",  I cannot do > this. You can, but you have to use the mutable property of the

Re: [CIL users] changing name of functions

2009-12-17 Thread ThanhVu (Vu) Nguyen
> > 1) After I change the original statement s to a new one s' , I want > s'.id to be the same as s.id. Using the "method vinst", I cannot do > this. > > 2) And the return type of "method vinst" is "Cil.instr list > Cil.visitAction" so I cannot call ChangeTo(new_stmt) . > I made some

Re: [CIL users] changing name of functions

2009-12-17 Thread ThanhVu (Vu) Nguyen
First thanks for your quick reply, After rewritting the code as suggested so that it uses "method vinst i" (looks much cleaner), I face 2 problems here. 1) After I change the original statement s to a new one s' , I want s'.id to be the same as s.id. Using the "method vinst", I cannot do t

Re: [CIL users] changing name of functions

2009-12-17 Thread Gabriel Kerneis
Hi, Your code might work on simple examples, but it will probably break on real programms. Could you give a real example of what you are trying to do? Don't you want to change the name of the function in it's definition too? What if there are function pointers? All this can be changed very eas