[Mlir-commits] [mlir] e2f16be - Fix clang-tidy warnings in MLIR Python bindings (NFC)
Mehdi Amini
llvmlistbot at llvm.org
Tue Oct 19 10:15:54 PDT 2021
Author: Mehdi Amini
Date: 2021-10-19T17:15:20Z
New Revision: e2f16be5991af84e508fcd197bb5deb841aa0dc2
URL: https://github.com/llvm/llvm-project/commit/e2f16be5991af84e508fcd197bb5deb841aa0dc2
DIFF: https://github.com/llvm/llvm-project/commit/e2f16be5991af84e508fcd197bb5deb841aa0dc2.diff
LOG: Fix clang-tidy warnings in MLIR Python bindings (NFC)
Added:
Modified:
mlir/lib/Bindings/Python/IRAffine.cpp
mlir/lib/Bindings/Python/IRCore.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Bindings/Python/IRAffine.cpp b/mlir/lib/Bindings/Python/IRAffine.cpp
index 0027b68ee073d..50a96c8c8cede 100644
--- a/mlir/lib/Bindings/Python/IRAffine.cpp
+++ b/mlir/lib/Bindings/Python/IRAffine.cpp
@@ -555,6 +555,7 @@ void mlir::python::populateIRAffine(py::module &m) {
mlirAffineMapCompressUnusedSymbols(
maps.data(), maps.size(), compressed.data(), populate);
std::vector<PyAffineMap> res;
+ res.reserve(compressed.size());
for (auto m : compressed)
res.push_back(PyAffineMap(context->getRef(), m));
return res;
diff --git a/mlir/lib/Bindings/Python/IRCore.cpp b/mlir/lib/Bindings/Python/IRCore.cpp
index ed96bafe41919..4fc581b5dee77 100644
--- a/mlir/lib/Bindings/Python/IRCore.cpp
+++ b/mlir/lib/Bindings/Python/IRCore.cpp
@@ -1976,7 +1976,7 @@ void mlir::python::populateIRCore(py::module &m) {
if (frames.empty())
throw py::value_error("No caller frames provided");
MlirLocation caller = frames.back().get();
- for (PyLocation frame :
+ for (const PyLocation &frame :
llvm::reverse(llvm::makeArrayRef(frames).drop_back()))
caller = mlirLocationCallSiteGet(frame.get(), caller);
return PyLocation(context->getRef(),
More information about the Mlir-commits
mailing list