Expand description
Generic function specialization pass.
This module provides the specialization pass that transforms CallGeneric
instructions into regular Call instructions by:
- Collecting all
CallGenericinstructions in the analyzed functions - For each unique (func_name, type_args) combination, creating a specialized function
- Rewriting
CallGenerictoCallwith the specialized function name
§Architecture
The specialization pass runs after semantic analysis but before CFG building. It transforms the AIR in-place and adds new specialized functions to the output.
Structs§
- Specialization
Key - A key for a specialized function: (base_function_name, type_arguments).
- Specialization
Refs - Function/method references discovered while specializing — feed back into the lazy work queue so reachability stays closed under specialization.
Functions§
- specialize
- Perform the specialization pass on the analyzed-functions accumulator.
Type Aliases§
- Analyzed
Row - One row in the analyzed-functions accumulator: an analyzed body plus its per-function string and byte literal pools (remapped to global tables later).