Re: [CIL users] different kinds of statement from Cil.stmtkind

2009-07-15 Thread Gabriel Kerneis
On Tue, Jul 14, 2009 at 05:19:52PM -0400, Stephen Magill wrote: > Cil.Instr([Cil.Call(None, Cil.Lval (Var v, NoOffset), [Const > Int64.zero], loc)]) -> > if v.name = "exit" then ... ^^^ there is a typo here, it's v.vname This could be rewritten: Cil.Instr([Cil.Call(None, Cil.Lval (V

Re: [CIL users] different kinds of statement from Cil.stmtkind

2009-07-14 Thread Stephen Magill
I believe it would be something like Cil.Instr([Cil.Call(None, Cil.Lval (Var v, NoOffset), [Const Int64.zero], loc)]) -> if v.name = "exit" then ...here we know we have an exit(0) statement... That is, "exit(0)" is treated as a function call. --Stephen On Tue, Jul 14, 2009 at 4:36 AM, Tha

Re: [CIL users] different kinds of statement from Cil.stmtkind

2009-07-14 Thread ThanhVu (Vu) Nguyen
The example that Chris gave includes Break, Return etc ... just wondering what about exist ? e.g.,what Cil.skind would match this statement exit (0); ? Thanks VN - On Wed, Jul 8, 2009 at 1:45 AM, ThanhVu (Vu) Nguyen < nguyenthanh...@gmail.com> wrote: > Ah these are very helpful , I

Re: [CIL users] different kinds of statement from Cil.stmtkind

2009-07-08 Thread ThanhVu (Vu) Nguyen
Ah these are very helpful , I will take a look at them tomorrow morning -- thank you for the quick reply ! VN - On Wed, Jul 8, 2009 at 1:35 AM, Christoph Spiel wrote: > Hi Vu, > > On Wed, Jul 08, 2009 at 12:39:22AM -0600, ThanhVu (Vu) Nguyen wrote: > > Hi, can I find out what kind of statement

Re: [CIL users] different kinds of statement from Cil.stmtkind

2009-07-08 Thread Christoph Spiel
Hi Vu, On Wed, Jul 08, 2009 at 12:39:22AM -0600, ThanhVu (Vu) Nguyen wrote: > Hi, can I find out what kind of statement (e.g., a single statement, a > block of statements, etc) from a given Cil.stmtkind? To distinguish between the kinds of statments (Instr, Return, Goto, etc.) you can j

[CIL users] different kinds of statement from Cil.stmtkind

2009-07-07 Thread ThanhVu (Vu) Nguyen
Hi, can I find out what kind of statement (e.g., a single statement, a block of statements, etc) from a given Cil.stmtkind ? For example if my Cil.stmtkind c has the content{a single statement} vs c has the content {a; block; of; many; statements;} ? Thanks , VN - ---