aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Bindings/Python/IRModule.h
diff options
context:
space:
mode:
authorTomás Longeri <tlongeri@google.com>2023-10-18 16:53:18 +0200
committerGitHub <noreply@github.com>2023-10-18 16:53:18 +0200
commit5a600c23f9e01f58bac09a8fad096e194fc90ae2 (patch)
tree3fea326184dc36ea2935c635351752459a403146 /mlir/lib/Bindings/Python/IRModule.h
parenta3a0f59a1e1cb0ac02f06b19f730ea05a6541c96 (diff)
downloadllvm-5a600c23f9e01f58bac09a8fad096e194fc90ae2.zip
llvm-5a600c23f9e01f58bac09a8fad096e194fc90ae2.tar.gz
llvm-5a600c23f9e01f58bac09a8fad096e194fc90ae2.tar.bz2
[mlir][python] Expose `PyInsertionPoint`'s reference operation (#69082)
The reason I want this is that I am writing my own Python bindings and would like to use the insertion point from `PyThreadContextEntry::getDefaultInsertionPoint()` to call C++ functions that take an `OpBuilder` (I don't need to expose it in Python but it also seems appropriate). AFAICT, there is currently no way to translate a `PyInsertionPoint` into an `OpBuilder` because the operation is inaccessible.
Diffstat (limited to 'mlir/lib/Bindings/Python/IRModule.h')
-rw-r--r--mlir/lib/Bindings/Python/IRModule.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/mlir/lib/Bindings/Python/IRModule.h b/mlir/lib/Bindings/Python/IRModule.h
index 3ca7dd8..c5412e7 100644
--- a/mlir/lib/Bindings/Python/IRModule.h
+++ b/mlir/lib/Bindings/Python/IRModule.h
@@ -833,6 +833,7 @@ public:
const pybind11::object &excTb);
PyBlock &getBlock() { return block; }
+ std::optional<PyOperationRef> &getRefOperation() { return refOperation; }
private:
// Trampoline constructor that avoids null initializing members while