Builder
builder
¶
PyASTBuilder
dataclass
¶
Builder for xDSL modules from aspects of a Python function.
Source code in xdsl/frontend/pyast/utils/builder.py
type_registry: TypeRegistry
instance-attribute
¶
Mappings between source code and IR type.
function_registry: FunctionRegistry
instance-attribute
¶
Mappings between functions and their operation types.
literal_registry: LiteralRegistry
instance-attribute
¶
Mappings between literal types and their operation constructors.
file: str | None
instance-attribute
¶
The file path of the function being built.
globals: dict[str, Any]
instance-attribute
¶
Global information for the function being built, including all the imports.
function_ast: ast.FunctionDef
instance-attribute
¶
The AST tree for the function being built.
build_context: Context
instance-attribute
¶
The xDSL context to use when applying transformations to the built module.
post_transforms: PassPipeline
instance-attribute
¶
An ordered list of passes and callbacks to apply to the built module.
function_definition_constructor: FunctionDefinitionConstructor = build_func
class-attribute
instance-attribute
¶
Construct the operation for each function.
return_constructor: ReturnConstructor = build_return
class-attribute
instance-attribute
¶
Construct return operations, optionally omitting the terminator.
__init__(type_registry: TypeRegistry, function_registry: FunctionRegistry, literal_registry: LiteralRegistry, file: str | None, globals: dict[str, Any], function_ast: ast.FunctionDef, build_context: Context, post_transforms: PassPipeline, function_definition_constructor: FunctionDefinitionConstructor = build_func, return_constructor: ReturnConstructor = build_return) -> None
¶
build() -> ModuleOp
¶
Build a module from the builder state.