Crate gruel_air

Crate gruel_air 

Source
Expand description

Analyzed Intermediate Representation (AIR) - Typed IR.

AIR is the second IR in the Gruel compiler pipeline. It is generated from RIR after semantic analysis and type checking.

Key characteristics:

  • Fully typed: all types are resolved
  • Per-function: generated lazily for each function
  • Ready for codegen: can be lowered directly to machine code

Inspired by Zig’s AIR (Analyzed Intermediate Representation).

Modules§

specialize
Generic function specialization pass.

Structs§

Air
The complete AIR for a function.
AirCallArg
An argument in a function call (AIR level).
AirInst
A single AIR instruction.
AirPlace
A memory location that can be read from or written to.
AirPlaceRef
A reference to a place in AIR - stored as index into the places array.
AirRef
A reference to an instruction in the AIR.
AnalysisStateRemapping
Remapping information for updating AIR after merging.
AnalyzedFunction
Result of analyzing a function.
ArrayTypeId
A unique identifier for an array type. This is needed because Type is Copy, so we can’t use Box for the element type.
ConstraintContext
Context for constraint generation within a single function.
ConstraintGenerator
Constraint generator that walks RIR and generates type constraints.
EnumData
Data for an enum type in the intern pool.
EnumDef
Definition of an enum type.
EnumId
A unique identifier for an enum definition.
ExprInfo
Result of constraint generation for an expression.
FunctionAnalysisState
Per-function mutable state during semantic analysis.
FunctionAnalyzer
Per-function mutable state during semantic analysis.
FunctionAnalyzerOutput
Output from analyzing a single function.
FunctionInfo
Information about a function.
FunctionOutputRemapping
Remapping information for updating AIR after merging.
FunctionSig
Information about a function during constraint generation.
GatherOutput
Output from the declaration gathering phase.
InternedType
Interned type index - 32 bits, Copy, cheap comparison.
LocalVarInfo
Information about a local variable during constraint generation.
MergedAnalysisState
Merged state from multiple function analyses.
MergedFunctionOutput
Merge multiple function analyzer outputs into a single result.
MethodInfo
Information about a method in an impl block.
MethodSig
Information about a method during constraint generation.
ModuleDef
Definition of a module (imported file).
ModuleId
A unique identifier for a module (imported file).
ModuleRegistry
Thread-safe registry for modules.
ParamArena
Central storage for all function/method parameter data.
ParamRange
A range of parameters in the ParamArena.
ParamVarInfo
Information about a function parameter during constraint generation.
PtrConstTypeId
A unique identifier for a ptr const T type. This is needed because Type is Copy, so we can’t use Box for the pointee type.
PtrMutTypeId
A unique identifier for a ptr mut T type. This is needed because Type is Copy, so we can’t use Box for the pointee type.
Sema
Semantic analyzer that converts RIR to AIR.
SemaContext
Context for semantic analysis, designed for parallel function analysis.
SemaContextInferenceContext
Pre-computed type information for constraint generation.
SemaOutput
Output from semantic analysis.
StructData
Data for a struct type in the intern pool.
StructDef
Definition of a struct type.
StructField
A field in a struct definition.
StructId
A unique identifier for a struct definition.
Substitution
A substitution mapping type variables to their resolved types.
Type
A type in the Gruel type system.
TypeInternPool
Thread-safe intern pool for all composite types.
TypeInternPoolStats
Statistics about the intern pool contents.
TypeVarAllocator
Allocator for fresh type variables.
TypeVarId
Unique identifier for a type variable.
UnificationError
An error that occurred during unification.
Unifier
Unification engine for type inference.

Enums§

AirArgMode
Argument passing mode in AIR.
AirInstData
AIR instruction data - fully typed operations.
AirParamMode
Parameter passing mode in AIR.
AirPattern
A pattern in a match expression (AIR level - typed).
AirPlaceBase
The base of a place - where the memory location starts.
AirProjection
A projection applied to a place to reach a nested location.
ConstValue
A value that can be computed at compile time.
Constraint
A type constraint generated during analysis.
InferType
Internal type representation during inference.
TypeData
Type data stored in the intern pool.
TypeKind
The kind of a type - used for pattern matching.
UnifyResult
Result of unifying two types.

Constants§

PARAM_SLOT_MARKER
Sentinel value used to encode parameter slots in AIR instructions.

Functions§

parse_array_type_syntax
Parse array type syntax “[T; N]” and return (element_type_str, length).