Skip to content
Snippets Groups Projects
Commit 8dc4d8e9 authored by Basile Desloges's avatar Basile Desloges
Browse files

[eacsl:codegen] Create a helper function to build a block statement from a list of statements

parent 8a36630f
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,7 @@ open Cil_types ...@@ -29,6 +29,7 @@ open Cil_types
let stmt sk = Cil.mkStmt ~valid_sid:true sk let stmt sk = Cil.mkStmt ~valid_sid:true sk
let instr i = stmt (Instr i) let instr i = stmt (Instr i)
let block_stmt blk = stmt (Block blk) let block_stmt blk = stmt (Block blk)
let block_from_stmts stmts = block_stmt (Cil.mkBlock stmts)
let call ~loc ?result e args = instr (Call(result, e, args, loc)) let call ~loc ?result e args = instr (Call(result, e, args, loc))
let assigns ~loc ~result e = instr (Set(result, e, loc)) let assigns ~loc ~result e = instr (Set(result, e, loc))
......
...@@ -36,6 +36,9 @@ val block: stmt -> block -> stmt ...@@ -36,6 +36,9 @@ val block: stmt -> block -> stmt
val block_stmt: block -> stmt val block_stmt: block -> stmt
(** Create a block statement from a block *) (** Create a block statement from a block *)
val block_from_stmts: stmt list -> stmt
(** Create a block statement from a statement list. *)
val assigns: loc:location -> result:lval -> exp -> stmt val assigns: loc:location -> result:lval -> exp -> stmt
(** [assigns ~loc ~result value] create a statement to assign the [value] (** [assigns ~loc ~result value] create a statement to assign the [value]
expression to the [result] lval. *) expression to the [result] lval. *)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment