Skip to main content

Module specialize

Module specialize 

Source
Expand description

Generic function specialization pass.

This module provides the specialization pass that transforms CallGeneric instructions into regular Call instructions by:

  1. Collecting all CallGeneric instructions in the analyzed functions
  2. For each unique (func_name, type_args) combination, creating a specialized function
  3. Rewriting CallGeneric to Call with 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§

SpecializationKey
A key for a specialized function: (base_function_name, type_arguments).

Functions§

specialize
Perform the specialization pass on the sema output.