Factory
This module defines a factory method that creates a compiler function based on an IRBuilder
.
The compiler function, that can be generated using the factory, should be used to to compile a certain type of input, based on the front-end that is being used, to IR code. This is the first step of compilation, which is followed by a compilation from IR to the targeted backend.
ir_compiler_factory(builder)
Constructs an IR compiler function for a specific input type by using an IRBuilder
.
The factory function uses an IRBuilder[InputType]
to create an IR compiler function that
converts an input of type InputType
and returns a Model. The IR compiler must be named
'compile_to_model' by convention to ensure accessibility to other engines in the framework.
PARAMETER | DESCRIPTION |
---|---|
builder
|
A concrete implementation of the generic class
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Callable[[InputType], Model]
|
A function that compiles an |