B2R2


IRBuilder Type

IRBuilder accumulates IR statements while lifting, and emits them into an array of statements at the end of a lifting process.

Record fields

Record Field Description

LabelCount

Full Usage: LabelCount

Field type: int
Modifiers: mutable
Field type: int

TempVarCount

Full Usage: TempVarCount

Field type: int
Modifiers: mutable
Field type: int

Constructors

Constructor Description

IRBuilder(n)

Full Usage: IRBuilder(n)

Parameters:
    n : int - The size of the internal buffer.

Returns: IRBuilder

Initialize an IR statement builder of internal buffer size n.

n : int

The size of the internal buffer.

Returns: IRBuilder

Instance members

Instance member Description

this.Append(stmt)

Full Usage: this.Append(stmt)

Parameters:
    stmt : Stmt - IR statement to add.

Append a new IR statement to the builder.

stmt : Stmt

IR statement to add.

this.NewSymbol(name)

Full Usage: this.NewSymbol(name)

Parameters:
    name : string

Returns: Symbol

Create a new symbol for a label.

name : string
Returns: Symbol

this.NewTempVar(rt)

Full Usage: this.NewTempVar(rt)

Parameters:
Returns: Expr

Create a new temporary variable of RegType (rt).

rt : RegType
Returns: Expr

this.ToStmts()

Full Usage: this.ToStmts()

Returns: Stmt[] Returns a list of IR statements.

Create an array of IR statements from the buffer.

Returns: Stmt[]

Returns a list of IR statements.