Expand description
Control Flow Graph IR for the Gruel compiler.
This crate provides a CFG-based intermediate representation that sits between AIR (typed, structured) and X86Mir (machine-specific).
The CFG representation makes control flow explicit through basic blocks and terminators, which is essential for:
- Linear type checking
- Drop elaboration
- Liveness analysis
- Other dataflow analyses
§Pipeline
AIR (structured) → CFG (explicit control flow) → X86Mir (machine code)Modules§
- drop_
names - Shared drop-glue utilities: reachability checks and synthesized symbol names.
Structs§
- Basic
Block - A basic block in the CFG.
- BlockId
- A basic block identifier.
- Cfg
- The complete CFG for a function.
- CfgBuilder
- Builder that converts AIR to CFG.
- CfgCall
Arg - An argument in a function call.
- CfgInst
- A single CFG instruction with its metadata.
- CfgOutput
- Output from CFG construction.
- CfgValue
- A reference to a value (instruction result) in the CFG.
- Make
Slice Data - Boxed payload for
CfgInstData::MakeSlice(ADR-0064 / ADR-0066). - Place
- A memory location that can be read from or written to.
- Spawn
Target - ADR-0084: codegen bookkeeping for one
@spawn(fn, arg)call. - Struct
Def - Definition of a struct type.
- Struct
Id - A unique identifier for a struct definition.
- Type
- A type in the Gruel type system.
Enums§
- CfgArg
Mode - Argument passing mode in CFG. Mirrors [
gruel_air::AirArgMode]; theMutRef/Refmarkers survive ADR-0076 as the legacy by-pointer ABI signal used for parameters whose declared type cannot itself be wrapped asRef(...)/MutRef(...)(notably interface-typed parameters). - CfgInst
Data - CFG instruction data.
- Place
Base - The base of a place - where the memory location starts.
- Projection
- A projection applied to a place to reach a nested location.
- Terminator
- Block terminator - how control leaves a basic block.
- Type
Kind - The kind of a type - used for pattern matching.