package bap-std

  1. Overview
  2. Docs
The Binary Analysis Platform Standard Library

Install

Dune Dependency

Authors

Maintainers

Sources

v2.4.0.tar.gz
sha256=63ada71fa4f602bd679174dc6bf780d54aeded40ad4ec20d256df15886e3d2d5
md5=b8b1aff8c6846f2213eafc54de07b304

doc/bap/Bap/Std/Blk/Builder/index.html

Module Blk.Builder

Builder interface.

type t

This interface provides an efficient way to build new blocks. It is also useful, when rebuilding existing block. It is the user responsibility to preserve the uniqueness of identifiers throughout the program instance.

val create : ?tid:tid -> ?phis:int -> ?defs:int -> ?jmps:int -> unit -> t

create ~tid ~phis ~defs ~jmp () creates a block builder. If tid parameter is specified, then the new block will have this tid. If any of phis, defs or jmps parameters are specified, the provtided number would be used as a hint of the expected amount of the corresponding entries. Since it is the hint, it can mismatch with the actual size. The hint must be a positive number.

val init : ?same_tid:bool -> ?copy_phis:bool -> ?copy_defs:bool -> ?copy_jmps:bool -> blk term -> t

init blk creates a builder based on an existing block. If copy_phis, copy_defs or copy_jmps is true (defaults to false), then prepopulate builder with corresponding terms from block blk. If same_tid is true (default), then a resulting block will have the same tid as block blk. Otherwise, a fresh new tid will be created.

val add_def : t -> def term -> unit

appends a definition

val add_jmp : t -> jmp term -> unit

appends a jump

val add_phi : t -> phi term -> unit

appends a phi node

val add_elt : t -> elt -> unit

appends generic element

val result : t -> blk term

returns current result

OCaml

Innovation. Community. Security.