Python bindings: make FunctionContext behave more like BlockContext
Provide a function `arg` that returns the function argument as a value handle, similar to block arguments. This makes function context managers in Python similar to block context managers, which is more consistent given that the function context manager sets the insertion point to the first block of the function and that arguments of that block are those of the function. This prepares the removal of PythonMLIREmitter class and its bind_function_arguments helper. Additionally, provide a helper method in PythonMLIRModule to define a function and immediately create a context for it. Update the tests that are already using context managers to use the function context manager instead of creating the function manually. PiperOrigin-RevId: 238421087
Loading
Please sign in to comment