CompilationStage#
Module: iqm.cpc.compiler.compilation_stage
- class iqm.cpc.compiler.compilation_stage.CompilationStage(name, info='')#
Bases:
objectSequence of compiler passes that are applied to the data.
The data and context are returned after all passes have been applied. A pass is a function that takes the data, context and pass options as arguments and returns the modified data. The context is a dictionary that can contain any information that needs to be passed between the passes and accumulates stateful side effects.
Methods
Add multiple passes to the stage.
Get pass function argument names.
Returns all signature metadata in a single call.
Get pass function names
Run all the passes in the stage on the data and context.
- add_passes(*passes, index=None)#
Add multiple passes to the stage.
- run(data, context, options)#
Run all the passes in the stage on the data and context. The data and context are returned after all passes have been applied.
- Parameters:
data (Any) – The data to be processed.
context (dict[str, Any]) – A dictionary containing any additional information that needs to be passed between the passes.
options (dict[str, dict[str, dict[str, Any]]]) – A dictionary of stage’s pass function arguments and their values (mapped to the pass function name)
- Returns:
The processed data and context.
- Return type:
Inheritance
