From 09f07f5a601a264d69bf6d1c65fcd9a6b067497e Mon Sep 17 00:00:00 2001 From: Martin Erhart Date: Fri, 4 Oct 2024 16:08:00 +0200 Subject: [PATCH] Fix compiler warnings --- lib/Dialect/DC/Transforms/DCPrintDot.cpp | 2 +- unittests/Dialect/OM/Evaluator/EvaluatorTests.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Dialect/DC/Transforms/DCPrintDot.cpp b/lib/Dialect/DC/Transforms/DCPrintDot.cpp index c3cadb0b6352..51b2a1f4d4b9 100644 --- a/lib/Dialect/DC/Transforms/DCPrintDot.cpp +++ b/lib/Dialect/DC/Transforms/DCPrintDot.cpp @@ -136,7 +136,7 @@ valueToName(const SmallVector &values, SmallVector> res; for (auto [i, v] : llvm::enumerate(values)) { auto found = false; - for (const auto [key, value] : currentMap) { + for (const auto &[key, value] : currentMap) { if (v == key) { res.push_back({v, value}); found = true; diff --git a/unittests/Dialect/OM/Evaluator/EvaluatorTests.cpp b/unittests/Dialect/OM/Evaluator/EvaluatorTests.cpp index 25c2b920a84c..18920b0cf42a 100644 --- a/unittests/Dialect/OM/Evaluator/EvaluatorTests.cpp +++ b/unittests/Dialect/OM/Evaluator/EvaluatorTests.cpp @@ -1055,7 +1055,7 @@ TEST(EvaluatorTests, ListConcat) { auto finalList = llvm::cast(fieldValue.get())->getElements(); - ASSERT_EQ(3, finalList.size()); + ASSERT_EQ(3U, finalList.size()); ASSERT_EQ(0, llvm::cast(finalList[0].get()) ->getAs() @@ -1114,7 +1114,7 @@ TEST(EvaluatorTests, ListConcatField) { auto finalList = llvm::cast(fieldValue.get())->getElements(); - ASSERT_EQ(3, finalList.size()); + ASSERT_EQ(3U, finalList.size()); ASSERT_EQ(0, llvm::cast(finalList[0].get()) ->getAs()