Fix clang-tidy warnings in MLIR Python bindings (NFC)

This commit is contained in:
Mehdi Amini 2021-10-19 17:13:54 +00:00
parent c1ca9e3077
commit e2f16be599
2 changed files with 2 additions and 1 deletions

View File

@ -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;

View File

@ -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(),