Skip to content

Commit ea2e83a

Browse files
committed
[mlir][Python] Apply ClangTidy findings.
move constructors should be marked noexcept
1 parent 13c648f commit ea2e83a

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

mlir/lib/Bindings/Python/ExecutionEngineModule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class PyExecutionEngine {
2020
public:
2121
PyExecutionEngine(MlirExecutionEngine executionEngine)
2222
: executionEngine(executionEngine) {}
23-
PyExecutionEngine(PyExecutionEngine &&other)
23+
PyExecutionEngine(PyExecutionEngine &&other) noexcept
2424
: executionEngine(other.executionEngine) {
2525
other.executionEngine.ptr = nullptr;
2626
}

mlir/lib/Bindings/Python/IRInterfaces.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ class PyShapedTypeComponents {
326326
: shape(std::move(shape)), elementType(elementType), attribute(attribute),
327327
ranked(true) {}
328328
PyShapedTypeComponents(PyShapedTypeComponents &) = delete;
329-
PyShapedTypeComponents(PyShapedTypeComponents &&other)
329+
PyShapedTypeComponents(PyShapedTypeComponents &&other) noexcept
330330
: shape(other.shape), elementType(other.elementType),
331331
attribute(other.attribute), ranked(other.ranked) {}
332332

mlir/lib/Bindings/Python/IRModule.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
7+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
78
//===----------------------------------------------------------------------===//
89

910
#ifndef MLIR_BINDINGS_PYTHON_IRMODULES_H
@@ -53,7 +54,7 @@ class PyObjectRef {
5354
"cannot construct PyObjectRef with null referrent");
5455
assert(this->object && "cannot construct PyObjectRef with null object");
5556
}
56-
PyObjectRef(PyObjectRef &&other)
57+
PyObjectRef(PyObjectRef &&other) noexcept
5758
: referrent(other.referrent), object(std::move(other.object)) {
5859
other.referrent = nullptr;
5960
assert(!other.object);
@@ -484,7 +485,8 @@ class PyDialectRegistry {
484485
mlirDialectRegistryDestroy(registry);
485486
}
486487
PyDialectRegistry(PyDialectRegistry &) = delete;
487-
PyDialectRegistry(PyDialectRegistry &&other) : registry(other.registry) {
488+
PyDialectRegistry(PyDialectRegistry &&other) noexcept
489+
: registry(other.registry) {
488490
other.registry = {nullptr};
489491
}
490492

mlir/lib/Bindings/Python/Pass.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ namespace {
2323
class PyPassManager {
2424
public:
2525
PyPassManager(MlirPassManager passManager) : passManager(passManager) {}
26-
PyPassManager(PyPassManager &&other) : passManager(other.passManager) {
26+
PyPassManager(PyPassManager &&other) noexcept
27+
: passManager(other.passManager) {
2728
other.passManager.ptr = nullptr;
2829
}
2930
~PyPassManager() {

0 commit comments

Comments
 (0)