Skip to content

[mlir] explicitly delete copy ctor for DialectRegistry and OperationState #140963

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mlir/include/mlir/IR/DialectRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ class DialectRegistry {

public:
explicit DialectRegistry();
DialectRegistry(const DialectRegistry &) = delete;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this unintentionally changes the behavior to not allowing moving of DialectRegistry, I'll create a patch to add the explicit move constructor

DialectRegistry &operator=(const DialectRegistry &other) = delete;

template <typename ConcreteDialect>
void insert() {
Expand Down
4 changes: 2 additions & 2 deletions mlir/include/mlir/IR/OperationSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -985,9 +985,9 @@ struct OperationState {
BlockRange successors = {},
MutableArrayRef<std::unique_ptr<Region>> regions = {});
OperationState(OperationState &&other) = default;
OperationState(const OperationState &other) = default;
OperationState &operator=(OperationState &&other) = default;
OperationState &operator=(const OperationState &other) = default;
OperationState(const OperationState &other) = delete;
OperationState &operator=(const OperationState &other) = delete;
~OperationState();

/// Get (or create) a properties of the provided type to be set on the
Expand Down