iqm.cpc.compiler.compiler.CompilationStage#
- class iqm.cpc.compiler.compiler.CompilationStage(name)#
Bases:
object
Sequence 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 and context as arguments and returns the modified data and context. The context is a dictionary that can contain any information that needs to be passed between the passes.
Methods
add_passes
(*pass_functions)Add multiple passes to the stage.
ready
()Check if the stage is ready to run.
run
(data, context)Run all the passes in the stage on the data and context.
- Parameters:
name (str) –
- ready()#
Check if the stage is ready to run. A stage is ready if it has at least one pass defined.
- Return type:
- add_passes(*pass_functions)#
Add multiple passes to the stage.
- run(data, context)#
Run all the passes in the stage on the data and context. The data and context are returned after all passes have been applied.