[Mlir-commits] [mlir] ea2e83a - [mlir][Python] Apply ClangTidy findings.

Adrian Kuegel llvmlistbot at llvm.org
Mon Dec 11 01:43:57 PST 2023


Author: Adrian Kuegel
Date: 2023-12-11T09:43:08Z
New Revision: ea2e83af55e76540d69f9efcc341d321b4c0fd06

URL: https://github.com/llvm/llvm-project/commit/ea2e83af55e76540d69f9efcc341d321b4c0fd06
DIFF: https://github.com/llvm/llvm-project/commit/ea2e83af55e76540d69f9efcc341d321b4c0fd06.diff

LOG: [mlir][Python] Apply ClangTidy findings.

move constructors should be marked noexcept

Added: 
    

Modified: 
    mlir/lib/Bindings/Python/ExecutionEngineModule.cpp
    mlir/lib/Bindings/Python/IRInterfaces.cpp
    mlir/lib/Bindings/Python/IRModule.h
    mlir/lib/Bindings/Python/Pass.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Bindings/Python/ExecutionEngineModule.cpp b/mlir/lib/Bindings/Python/ExecutionEngineModule.cpp
index 3f834259622f7..b3df30583fc96 100644
--- a/mlir/lib/Bindings/Python/ExecutionEngineModule.cpp
+++ b/mlir/lib/Bindings/Python/ExecutionEngineModule.cpp
@@ -20,7 +20,7 @@ class PyExecutionEngine {
 public:
   PyExecutionEngine(MlirExecutionEngine executionEngine)
       : executionEngine(executionEngine) {}
-  PyExecutionEngine(PyExecutionEngine &&other)
+  PyExecutionEngine(PyExecutionEngine &&other) noexcept
       : executionEngine(other.executionEngine) {
     other.executionEngine.ptr = nullptr;
   }

diff  --git a/mlir/lib/Bindings/Python/IRInterfaces.cpp b/mlir/lib/Bindings/Python/IRInterfaces.cpp
index c3aac0b092bc7..54cfa56066eb8 100644
--- a/mlir/lib/Bindings/Python/IRInterfaces.cpp
+++ b/mlir/lib/Bindings/Python/IRInterfaces.cpp
@@ -326,7 +326,7 @@ class PyShapedTypeComponents {
       : shape(std::move(shape)), elementType(elementType), attribute(attribute),
         ranked(true) {}
   PyShapedTypeComponents(PyShapedTypeComponents &) = delete;
-  PyShapedTypeComponents(PyShapedTypeComponents &&other)
+  PyShapedTypeComponents(PyShapedTypeComponents &&other) noexcept
       : shape(other.shape), elementType(other.elementType),
         attribute(other.attribute), ranked(other.ranked) {}
 

diff  --git a/mlir/lib/Bindings/Python/IRModule.h b/mlir/lib/Bindings/Python/IRModule.h
index d99b87d19bbea..79b7e0c96188c 100644
--- a/mlir/lib/Bindings/Python/IRModule.h
+++ b/mlir/lib/Bindings/Python/IRModule.h
@@ -4,6 +4,7 @@
 // See https://llvm.org/LICENSE.txt for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //===----------------------------------------------------------------------===//
 
 #ifndef MLIR_BINDINGS_PYTHON_IRMODULES_H
@@ -53,7 +54,7 @@ class PyObjectRef {
            "cannot construct PyObjectRef with null referrent");
     assert(this->object && "cannot construct PyObjectRef with null object");
   }
-  PyObjectRef(PyObjectRef &&other)
+  PyObjectRef(PyObjectRef &&other) noexcept
       : referrent(other.referrent), object(std::move(other.object)) {
     other.referrent = nullptr;
     assert(!other.object);
@@ -484,7 +485,8 @@ class PyDialectRegistry {
       mlirDialectRegistryDestroy(registry);
   }
   PyDialectRegistry(PyDialectRegistry &) = delete;
-  PyDialectRegistry(PyDialectRegistry &&other) : registry(other.registry) {
+  PyDialectRegistry(PyDialectRegistry &&other) noexcept
+      : registry(other.registry) {
     other.registry = {nullptr};
   }
 

diff  --git a/mlir/lib/Bindings/Python/Pass.cpp b/mlir/lib/Bindings/Python/Pass.cpp
index 588a8e25414c6..a68421b61641f 100644
--- a/mlir/lib/Bindings/Python/Pass.cpp
+++ b/mlir/lib/Bindings/Python/Pass.cpp
@@ -23,7 +23,8 @@ namespace {
 class PyPassManager {
 public:
   PyPassManager(MlirPassManager passManager) : passManager(passManager) {}
-  PyPassManager(PyPassManager &&other) : passManager(other.passManager) {
+  PyPassManager(PyPassManager &&other) noexcept
+      : passManager(other.passManager) {
     other.passManager.ptr = nullptr;
   }
   ~PyPassManager() {


        


More information about the Mlir-commits mailing list