[Mlir-commits] [mlir] [mlir] Apply rule of five for Pass / OperationPass (PR #80998)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Feb 7 07:16:23 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff d42f3957cea0a8f45d5f3c11db229e2ea1e6d614 fc97bb41e3cd13ea15201d5384b1759f9a68ad34 -- mlir/include/mlir/Pass/Pass.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/include/mlir/Pass/Pass.h b/mlir/include/mlir/Pass/Pass.h
index efe482fd72..328f0a5a41 100644
--- a/mlir/include/mlir/Pass/Pass.h
+++ b/mlir/include/mlir/Pass/Pass.h
@@ -161,13 +161,13 @@ protected:
   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) {
+  Pass &operator=(const Pass &other) {
     this->passID = other.passID;
     this->opName = other.opName;
     return *this;
   }
-  Pass(Pass&&) = default;
-  Pass& operator=(Pass&&) = default;
+  Pass(Pass &&) = default;
+  Pass &operator=(Pass &&) = default;
 
   /// Returns the current pass state.
   detail::PassExecutionState &getPassState() {
@@ -359,9 +359,9 @@ class OperationPass : public Pass {
 protected:
   OperationPass(TypeID passID) : Pass(passID, OpT::getOperationName()) {}
   OperationPass(const OperationPass &) = default;
-  OperationPass& operator=(const OperationPass &) = default;
-  OperationPass(OperationPass&&) = default;
-  OperationPass& operator=(OperationPass&&) = default;
+  OperationPass &operator=(const OperationPass &) = default;
+  OperationPass(OperationPass &&) = default;
+  OperationPass &operator=(OperationPass &&) = default;
 
   /// Support isa/dyn_cast functionality.
   static bool classof(const Pass *pass) {
@@ -401,9 +401,9 @@ class OperationPass<void> : public Pass {
 protected:
   OperationPass(TypeID passID) : Pass(passID) {}
   OperationPass(const OperationPass &) = default;
-  OperationPass& operator=(const OperationPass &) = default;
-  OperationPass(OperationPass&&) = default;
-  OperationPass& operator=(OperationPass&&) = default;
+  OperationPass &operator=(const OperationPass &) = default;
+  OperationPass(OperationPass &&) = default;
+  OperationPass &operator=(OperationPass &&) = default;
 
   /// Indicate if the current pass can be scheduled on the given operation type.
   /// By default, generic operation passes can be scheduled on any operation.

``````````

</details>


https://github.com/llvm/llvm-project/pull/80998


More information about the Mlir-commits mailing list