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§
- BtFunction
Defn - The IR for a function definition.
- BtLabel
Identifier - A label identifier in IR.
- BtRoot
- The root of the BlueTac IR contains a list of definitions.
- BtStatic
Constant - The IR for a global read-only constant value.
- BtStatic
Storage Variable - The IR for a variable with static storage duration.
- BtSwitch
Case - A case in a switch statement.
Enums§
- BtBinary
Op - Binary operator.
- BtConstant
Value - 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.
- BtStatic
Storage Initializer - An initializer value for a static storage variable.
- BtType
- A data type in the BlueTac IR.
- BtUnary
Op - 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.