Module ir

Expand description

The ir module is responsible for lowering the C AST into the “BlueTac” intermediate representation (IR).

BlueTac is a custom three-address code (TAC) IR for the BlueC compiler. In the future, we’ll add a lower-level IR in SSA form.

Structs§

BtFunctionDefn
The IR for a function definition.
BtLabelIdentifier
A label identifier in IR.
BtRoot
The root of the BlueTac IR contains a list of definitions.
BtStaticConstant
The IR for a global read-only constant value.
BtStaticStorageVariable
The IR for a variable with static storage duration.
BtSwitchCase
A case in a switch statement.

Enums§

BtBinaryOp
Binary operator.
BtConstantValue
A constant arithmetic value.
BtDefinition
A BlueTac IR definition is either a function definition, a variable with static storage duration, or a read-only constant value with global lifetime (equivalent of a static storage duration).
BtInstruction
A BlueTac IR instruction.
BtStaticStorageInitializer
An initializer value for a static storage variable.
BtType
A data type in the BlueTac IR.
BtUnaryOp
Unary operator.
BtValue
An IR value is either a constant or a variable.

Functions§

translate
Lowers the C AST produced by the parser into BlueTac intermediate representation (IR), and then passes the generated IR to the codegen stage.