[Mlir-commits] [mlir] [mlir] Apply rule of five for Pass / OperationPass (PR #80998)
Andrei Golubev
llvmlistbot at llvm.org
Wed Feb 7 07:23:13 PST 2024
================
@@ -161,6 +161,13 @@ class Pass {
explicit Pass(TypeID passID, std::optional<StringRef> opName = std::nullopt)
: passID(passID), opName(opName) {}
Pass(const Pass &other) : Pass(other.passID, other.opName) {}
+ Pass &operator=(const Pass &other) {
+ this->passID = other.passID;
+ this->opName = other.opName;
+ return *this;
+ }
+ Pass(Pass &&) = delete;
----------------
andrey-golubev wrote:
apparently, `PassOptions` (a member field) is non-copyable and non-movable (which is probably why there's a user-provided copy semantics to begin with), thus, I have explicitly marked move semantics deleted in a fixup commit.
https://github.com/llvm/llvm-project/pull/80998
More information about the Mlir-commits
mailing list