Commit 89b0f1ee authored by Mehdi Amini's avatar Mehdi Amini
Browse files

Apply clang-tidy fixes for performance-unnecessary-value-param in IRInterfaces.cpp (NFC)

parent dc81dfa0
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -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();