We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b3c3f6 commit c336e54Copy full SHA for c336e54
mlir/lib/Bindings/Python/Globals.h
@@ -17,6 +17,7 @@
17
18
#include "NanobindUtils.h"
19
#include "mlir-c/IR.h"
20
+#include "mlir-c/Support.h"
21
#include "mlir/CAPI/Support.h"
22
#include "llvm/ADT/DenseMap.h"
23
#include "llvm/ADT/StringExtras.h"
@@ -155,9 +156,13 @@ class PyGlobals {
155
156
public:
157
TypeIDAllocator() : allocator(mlirTypeIDAllocatorCreate()) {}
158
~TypeIDAllocator() {
- if (!allocator.ptr)
159
+ if (allocator.ptr)
160
mlirTypeIDAllocatorDestroy(allocator);
161
}
162
+ TypeIDAllocator(const TypeIDAllocator &) = delete;
163
+ TypeIDAllocator(TypeIDAllocator &&other) : allocator(other.allocator) {
164
+ other.allocator.ptr = nullptr;
165
+ }
166
167
MlirTypeIDAllocator get() { return allocator; }
168
MlirTypeID allocate() {
0 commit comments