Skip to content

Commit 89b0f1e

Browse files
committed
Apply clang-tidy fixes for performance-unnecessary-value-param in IRInterfaces.cpp (NFC)
1 parent dc81dfa commit 89b0f1e

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

mlir/lib/Bindings/Python/IRInterfaces.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,9 @@ class PyInferTypeOpInterface
281281
std::optional<std::vector<PyRegion>> regions,
282282
DefaultingPyMlirContext context,
283283
DefaultingPyLocation location) {
284-
llvm::SmallVector<MlirValue> mlirOperands = wrapOperands(operandList);
285-
llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions(regions);
284+
llvm::SmallVector<MlirValue> mlirOperands =
285+
wrapOperands(std::move(operandList));
286+
llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions(std::move(regions));
286287

287288
std::vector<PyType> inferredTypes;
288289
PyMlirContext &pyContext = context.resolve();
@@ -319,10 +320,10 @@ class PyShapedTypeComponents {
319320
public:
320321
PyShapedTypeComponents(MlirType elementType) : elementType(elementType) {}
321322
PyShapedTypeComponents(py::list shape, MlirType elementType)
322-
: shape(shape), elementType(elementType), ranked(true) {}
323+
: shape(std::move(shape)), elementType(elementType), ranked(true) {}
323324
PyShapedTypeComponents(py::list shape, MlirType elementType,
324325
MlirAttribute attribute)
325-
: shape(shape), elementType(elementType), attribute(attribute),
326+
: shape(std::move(shape)), elementType(elementType), attribute(attribute),
326327
ranked(true) {}
327328
PyShapedTypeComponents(PyShapedTypeComponents &) = delete;
328329
PyShapedTypeComponents(PyShapedTypeComponents &&other)
@@ -347,14 +348,15 @@ class PyShapedTypeComponents {
347348
.def_static(
348349
"get",
349350
[](py::list shape, PyType &elementType) {
350-
return PyShapedTypeComponents(shape, elementType);
351+
return PyShapedTypeComponents(std::move(shape), elementType);
351352
},
352353
py::arg("shape"), py::arg("element_type"),
353354
"Create a ranked shaped type components object.")
354355
.def_static(
355356
"get",
356357
[](py::list shape, PyType &elementType, PyAttribute &attribute) {
357-
return PyShapedTypeComponents(shape, elementType, attribute);
358+
return PyShapedTypeComponents(std::move(shape), elementType,
359+
attribute);
358360
},
359361
py::arg("shape"), py::arg("element_type"), py::arg("attribute"),
360362
"Create a ranked shaped type components object with attribute.")
@@ -438,8 +440,9 @@ class PyInferShapedTypeOpInterface
438440
std::optional<PyAttribute> attributes, void *properties,
439441
std::optional<std::vector<PyRegion>> regions,
440442
DefaultingPyMlirContext context, DefaultingPyLocation location) {
441-
llvm::SmallVector<MlirValue> mlirOperands = wrapOperands(operandList);
442-
llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions(regions);
443+
llvm::SmallVector<MlirValue> mlirOperands =
444+
wrapOperands(std::move(operandList));
445+
llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions(std::move(regions));
443446

444447
std::vector<PyShapedTypeComponents> inferredShapedTypeComponents;
445448
PyMlirContext &pyContext = context.resolve();

0 commit comments

Comments
 (0)