[Mlir-commits] [mlir] [mlir] fix copying DialectRegistry and OperationState (PR #140963)

Maksim Levental llvmlistbot at llvm.org
Wed May 21 14:43:04 PDT 2025


https://github.com/makslevental created https://github.com/llvm/llvm-project/pull/140963

None

>From e9c59f7cbb860c027b04ad9b08c589664af2ebc4 Mon Sep 17 00:00:00 2001
From: Maksim Levental <maksim.levental at gmail.com>
Date: Wed, 21 May 2025 17:42:32 -0400
Subject: [PATCH] [mlir] fix copying DialectRegistry and OperationState

---
 mlir/include/mlir/IR/DialectRegistry.h  | 1 +
 mlir/include/mlir/IR/OperationSupport.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/mlir/include/mlir/IR/DialectRegistry.h b/mlir/include/mlir/IR/DialectRegistry.h
index d3d53488fe72d..0d2941ee1aa81 100644
--- a/mlir/include/mlir/IR/DialectRegistry.h
+++ b/mlir/include/mlir/IR/DialectRegistry.h
@@ -143,6 +143,7 @@ class DialectRegistry {
 
 public:
   explicit DialectRegistry();
+  DialectRegistry(const DialectRegistry&) = delete;
 
   template <typename ConcreteDialect>
   void insert() {
diff --git a/mlir/include/mlir/IR/OperationSupport.h b/mlir/include/mlir/IR/OperationSupport.h
index 2d9fb2bc5859e..d10bd9b86ff86 100644
--- a/mlir/include/mlir/IR/OperationSupport.h
+++ b/mlir/include/mlir/IR/OperationSupport.h
@@ -985,7 +985,7 @@ struct OperationState {
                  BlockRange successors = {},
                  MutableArrayRef<std::unique_ptr<Region>> regions = {});
   OperationState(OperationState &&other) = default;
-  OperationState(const OperationState &other) = default;
+  OperationState(const OperationState &other) = delete;
   OperationState &operator=(OperationState &&other) = default;
   OperationState &operator=(const OperationState &other) = default;
   ~OperationState();



More information about the Mlir-commits mailing list