package jasmin
Module Jasmin.ProgSource
include module type of struct include CoreIdent end
Source
type 'len gety = 'len CoreIdent.gety = | ETbool| ETint| ETword of Wsize.signedness option * Wsize.wsize| ETarr of Wsize.wsize * 'len
Source
type +'len gvar = private 'len CoreIdent.gvar = {v_name : Name.t;v_id : uid;v_kind : Wsize.v_kind;v_ty : 'len gty;v_dloc : L.t;v_annot : Annotations.annotations;
}module E = ExprSource
type 'len gexpr = | Pconst of Z.t| Pbool of bool| Parr_init of Wsize.wsize * 'len| Pvar of 'len ggvar| Pget of Memory_model.aligned * Warray_.arr_access * Wsize.wsize * 'len ggvar * 'len gexpr| Psub of Warray_.arr_access * Wsize.wsize * 'len * 'len ggvar * 'len gexpr| Pload of Memory_model.aligned * Wsize.wsize * 'len gexpr| Papp1 of Operators.sop1 * 'len gexpr| Papp2 of Operators.sop2 * 'len gexpr * 'len gexpr| PappN of Operators.opN * 'len gexpr list| Pif of 'len gty * 'len gexpr * 'len gexpr * 'len gexpr
Source
type 'len glval = | Lnone of L.t * 'len gty| Lvar of 'len gvar_i| Lmem of Memory_model.aligned * Wsize.wsize * L.t * 'len gexpr| Laset of Memory_model.aligned * Warray_.arr_access * Wsize.wsize * 'len gvar_i * 'len gexpr| Lasub of Warray_.arr_access * Wsize.wsize * 'len * 'len gvar_i * 'len gexpr
Source
type ('len, 'info, 'asm) ginstr_r = | Cassgn of 'len glval * E.assgn_tag * 'len gty * 'len gexpr| Copn of 'len glvals * E.assgn_tag * 'asm Sopn.sopn * 'len gexprs| Csyscall of 'len glvals * (Wsize.wsize * BinNums.coq_Z) Syscall_t.syscall_t * 'len gexprs| Cassert of 'len assertion| Cif of 'len gexpr * ('len, 'info, 'asm) gstmt * ('len, 'info, 'asm) gstmt| Cfor of 'len gvar_i * 'len grange * ('len, 'info, 'asm) gstmt| Cwhile of E.align * ('len, 'info, 'asm) gstmt * 'len gexpr * IInfo.t * 'info * ('len, 'info, 'asm) gstmt| Ccall of 'len glvals * funname * 'len gexprs
Source
and ('len, 'info, 'asm) ginstr = {i_desc : ('len, 'info, 'asm) ginstr_r;i_loc : L.i_loc;i_info : 'info;i_annot : Annotations.annotations;
}Source
type 'asm arch_info = {pd : Wsize.wsize;asmOp : 'asm Sopn.sopn Sopn.asmOp;zero_extend_op : 'asm -> Wsize.wsize -> 'asm option;known_implicits : (CoreIdent.Name.t * string) list;flagnames : CoreIdent.Name.t list;
}Source
type ('len, 'info, 'asm) gfunc = {f_loc : L.t;f_annot : FInfo.f_annot;f_info : 'info;f_contract : 'len gfcontract option;f_cc : FInfo.call_conv;f_name : funname;f_tyin : 'len gty list;f_args : 'len gvar list;f_body : ('len, 'info, 'asm) gstmt;f_tyout : 'len gty list;f_ret_info : FInfo.return_info;f_ret : 'len gvar_i list;
}Computes the set of variables that the given instruction writes to, if any. NB: control flow instructions (if, while, and for) do not write to any variable.
Whether the instruction has an “effect”. What is treated as an effect is:
- a function call / system call;
- a memory store.
Note that other control-flow constructions do not count as an effect (i.e., this function does not recurse within nested code blocks).
iter_instr f c traverses statement c and applies function f to every instruction.