projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
234c4d2
)
[MLIR] [Python] Add `owner` to `mlir.ir.Block`
author
John Demme
<john.demme@microsoft.com>
Thu, 19 Aug 2021 07:02:09 +0000
(
00:02
-0700)
committer
John Demme
<john.demme@microsoft.com>
Thu, 19 Aug 2021 07:02:09 +0000
(
00:02
-0700)
Provides a way for python users to access the owning Operation from a Block.
mlir/lib/Bindings/Python/IRCore.cpp
patch
|
blob
|
history
diff --git
a/mlir/lib/Bindings/Python/IRCore.cpp
b/mlir/lib/Bindings/Python/IRCore.cpp
index
3e927ce
..
d6305e7
100644
(file)
--- a/
mlir/lib/Bindings/Python/IRCore.cpp
+++ b/
mlir/lib/Bindings/Python/IRCore.cpp
@@
-2201,6
+2201,12
@@
void mlir::python::populateIRCore(py::module &m) {
//----------------------------------------------------------------------------
py::class_<PyBlock>(m, "Block")
.def_property_readonly(
+ "owner",
+ [](PyBlock &self) {
+ return self.getParentOperation()->createOpView();
+ },
+ "Returns the owning operation of this block.")
+ .def_property_readonly(
"arguments",
[](PyBlock &self) {
return PyBlockArgumentList(self.getParentOperation(), self.get());