IR Expressions. NOTE: You MUST create Expr/Stmt through the AST module. *NEVER* directly construct Expr nor Stmt.
Union case | Description |
Full Usage:
FuncName string
Parameters:
string
|
|
|
|
Full Usage:
Nil
|
|
|
|
|
|
|
A temporary variable represents an internal (imaginary) register. Names of temporary variables should always be affixed by an underscore (_) and a number. This is to make sure that any temporary variable is unique in a CFG. For example, a temporary variable T can be represented as (T_2:I32), where 2 is a unique number assigned to the variable.
|
|
Undefined expression. This is rarely used, and it is a fatal error when we encounter this expression while evaluating a program. Some CPU manuals explicitly say that a register value is undefined after a certain operation. We model such cases with this expression.
|
Full Usage:
Var(RegType, RegisterID, string, RegisterSet)
Parameters:
RegType
Item2 : RegisterID
Item3 : string
Item4 : RegisterSet
|
A variable that represents a register of a CPU. Var (t, r, n) indicates a variable of type (t) that has RegisterID r and name (n). For example, (EAX:I32) represents the EAX register (of type I32). Note that name (n) is additional information that doesn't be used internally.
|