[mlir][python] Add generic operation parse APIs
Currently the bindings only allow for parsing IR with a top-level `builtin.module` op, since the parse APIs insert an implicit module op. This change adds `Operation.parse`, which returns whatever top-level op is actually in the source. To simplify parsing of specific operations, `OpView.parse` is also added, which handles the error checking for `OpView` subclasses. Reviewed By: ftynse, stellaraccident Differential Revision: https://reviews.llvm.org/D143352
Loading
Please sign in to comment