Add a `mlirModuleGetBody()` accessor to the C API and bind it in Python
authorMehdi Amini <joker.eph@gmail.com>
Wed, 28 Oct 2020 05:57:17 +0000 (05:57 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Wed, 28 Oct 2020 17:53:52 +0000 (17:53 +0000)
commit72023442c1eb3169389f469d4b804aff93497758
tree017f3efeac38a1fc4e5c98b08b860e2b71ddb14b
parent7011a2f3504b43e57eda5dbc1f23a3f9c1b44593
Add a `mlirModuleGetBody()` accessor to the C API and bind it in Python

Getting the body of a Module is a common need which justifies a
dedicated accessor instead of forcing users to go through the
region->blocks->front unwrapping manually.

Differential Revision: https://reviews.llvm.org/D90287
mlir/include/mlir-c/IR.h
mlir/lib/Bindings/Python/IRModules.cpp
mlir/lib/CAPI/IR/IR.cpp
mlir/test/Bindings/Python/dialects.py
mlir/test/CAPI/ir.c