B2R2


S Type

IL Statements. NOTE: You MUST create Expr/Stmt through the AST module. *NEVER* directly construct Expr nor Stmt.

Union cases

Union case Description

CJmp(Expr, Expr, Expr)

Full Usage: CJmp(Expr, Expr, Expr)

Parameters:

This statement represents a conditional jump to an LMark. The first argument specifies a jump condition. If the condition is true, jump to the address specified by the second argument. Otherwise, jump to the address specified by the third argument.

Item1 : Expr
Item2 : Expr
Item3 : Expr

IEMark uint32

Full Usage: IEMark uint32

Parameters:
    Item : uint32

Metadata representing the end of a machine instruction. It contains the length of the current instruction.

Item : uint32

ISMark uint32

Full Usage: ISMark uint32

Parameters:
    Item : uint32

Metadata representing the start of a machine instruction. More specifically, it contains the length of the instruction. There must be a single IMark per a machine instruction.

Item : uint32

InterCJmp(Expr, Expr, Expr)

Full Usage: InterCJmp(Expr, Expr, Expr)

Parameters:

This is a conditional jump instruction to another instruction. The first argument specifies a jump condition. If the condition is true, change the program counter to jump to the address specified by the second argument. Otherwise, jump to the address specified by the third argument.

Item1 : Expr
Item2 : Expr
Item3 : Expr

InterJmp(Expr, InterJmpKind)

Full Usage: InterJmp(Expr, InterJmpKind)

Parameters:

This is an unconditional jump instruction to another instruction. This is an inter-instruction jump unlike Jmp statement. The first argument is the jump target address.

Item1 : Expr
Item2 : InterJmpKind

Jmp Expr

Full Usage: Jmp Expr

Parameters:

This statement represents a jump (unconditional) to an LMark. The first argument specifies the target address.

Item : Expr

LMark Symbol

Full Usage: LMark Symbol

Parameters:

Metadata representing a label (as in an assembly language). LMark is only valid within a machine instruction.

Item : Symbol

Put(Expr, Expr)

Full Usage: Put(Expr, Expr)

Parameters:

This statement puts a value into a register. The first argument is a destination operand, and the second argument is a source operand. The destination operand should have either a Var or a TempVar. Example: [Put(T_1:I32, Load(LE, T_2:I32))] loads a 32-bit value from the address T2, and store the value to the temporary register T1.

Item1 : Expr
Item2 : Expr

SideEffect SideEffect

Full Usage: SideEffect SideEffect

Parameters:

This represents an instruction with side effects such as a system call.

Item : SideEffect

Store(Endian, Expr, Expr)

Full Usage: Store(Endian, Expr, Expr)

Parameters:

This statement stores a value into a memory. The first argument represents the endianness, the second argument is a destination operand, and the third argument is a value to store. Example: Store(LE, T_1:I32, T_2:I32) stores a 32-bit value T_2 into the address T_1

Item1 : Endian
Item2 : Expr
Item3 : Expr