diff options
author | Mehdi Amini <joker.eph@gmail.com> | 2023-10-20 01:37:09 -0700 |
---|---|---|
committer | Mehdi Amini <joker.eph@gmail.com> | 2023-11-18 15:38:21 -0800 |
commit | 89b0f1ee340b31f09d148ca542a41a9870fb0fad (patch) | |
tree | 3b33e826f1fede4466c6652d40dc31be7779ec8d | |
parent | dc81dfa029e09f4e26ec8820bb5c3cfc9d5c5460 (diff) |
Apply clang-tidy fixes for performance-unnecessary-value-param in IRInterfaces.cpp (NFC)
-rw-r--r-- | mlir/lib/Bindings/Python/IRInterfaces.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/mlir/lib/Bindings/Python/IRInterfaces.cpp b/mlir/lib/Bindings/Python/IRInterfaces.cpp index 136bb1b2b136..c3aac0b092bc 100644 --- a/mlir/lib/Bindings/Python/IRInterfaces.cpp +++ b/mlir/lib/Bindings/Python/IRInterfaces.cpp @@ -281,8 +281,9 @@ public: std::optional<std::vector<PyRegion>> regions, DefaultingPyMlirContext context, DefaultingPyLocation location) { - llvm::SmallVector<MlirValue> mlirOperands = wrapOperands(operandList); - llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions(regions); + llvm::SmallVector<MlirValue> mlirOperands = + wrapOperands(std::move(operandList)); + llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions(std::move(regions)); std::vector<PyType> inferredTypes; PyMlirContext &pyContext = context.resolve(); @@ -319,10 +320,10 @@ class PyShapedTypeComponents { public: PyShapedTypeComponents(MlirType elementType) : elementType(elementType) {} PyShapedTypeComponents(py::list shape, MlirType elementType) - : shape(shape), elementType(elementType), ranked(true) {} + : shape(std::move(shape)), elementType(elementType), ranked(true) {} PyShapedTypeComponents(py::list shape, MlirType elementType, MlirAttribute attribute) - : shape(shape), elementType(elementType), attribute(attribute), + : shape(std::move(shape)), elementType(elementType), attribute(attribute), ranked(true) {} PyShapedTypeComponents(PyShapedTypeComponents &) = delete; PyShapedTypeComponents(PyShapedTypeComponents &&other) @@ -347,14 +348,15 @@ public: .def_static( "get", [](py::list shape, PyType &elementType) { - return PyShapedTypeComponents(shape, elementType); + return PyShapedTypeComponents(std::move(shape), elementType); }, py::arg("shape"), py::arg("element_type"), "Create a ranked shaped type components object.") .def_static( "get", [](py::list shape, PyType &elementType, PyAttribute &attribute) { - return PyShapedTypeComponents(shape, elementType, attribute); + return PyShapedTypeComponents(std::move(shape), elementType, + attribute); }, py::arg("shape"), py::arg("element_type"), py::arg("attribute"), "Create a ranked shaped type components object with attribute.") @@ -438,8 +440,9 @@ public: std::optional<PyAttribute> attributes, void *properties, std::optional<std::vector<PyRegion>> regions, DefaultingPyMlirContext context, DefaultingPyLocation location) { - llvm::SmallVector<MlirValue> mlirOperands = wrapOperands(operandList); - llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions(regions); + llvm::SmallVector<MlirValue> mlirOperands = + wrapOperands(std::move(operandList)); + llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions(std::move(regions)); std::vector<PyShapedTypeComponents> inferredShapedTypeComponents; PyMlirContext &pyContext = context.resolve(); |