IR.InstrsManipulate possibly-reversed lists of instructions efficiently
type not_reversed_t = not_reversed tdefined for convenience: we can write Instrs.not_reversed_t in other modules instead of Instrs.not_reversed Instrs.t
val empty : _ tval append_list : not_reversed t -> Sil.instr list -> not_reversed tval prepend_list : not_reversed t -> Sil.instr list -> not_reversed tval of_list : Sil.instr list -> not_reversed tval filter_map :
not_reversed t ->
f:(Sil.instr -> Sil.instr option) ->
not_reversed tval map : not_reversed t -> f:(Sil.instr -> Sil.instr) -> not_reversed treplace every instruction instr with f instr. Preserve physical equality. *
val map_and_fold :
not_reversed t ->
f:('a -> Sil.instr -> 'a * Sil.instr) ->
init:'a ->
not_reversed treplace every instruction instr with snd (f context instr). The context is computed by folding f on init and previous instructions (before instr) in the collection. Preserve physical equality. *
val concat_map_and_fold :
not_reversed t ->
f:('a -> Sil.instr -> 'a * Sil.instr array) ->
init:'a ->
not_reversed tLike map_and_fold but replace every instruction instr with the list snd (f context instr) by threading an accumulator. Preserve physical equality. *
val concat_map :
not_reversed t ->
f:(Sil.instr -> Sil.instr array) ->
not_reversed treplace every instruction instr with the list f instr. Preserve physical equality. *
val reverse_order : not_reversed t -> reversed tval is_empty : _ t -> boolval count : _ t -> intval nth_exists : _ t -> int -> boolval pp :
?indent:bool ->
?print_types:bool ->
IStdlib.Pp.env ->
Stdlib.Format.formatter ->
_ t ->
unitval get_underlying_not_reversed : not_reversed t -> Sil.instr arrayval instrs_get_normal_vars : not_reversed t -> Ident.t list