From e4b2f66d7f7e27e01ecf4da240f1c39387dd9ede Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 16 Sep 2021 18:46:08 +0100 Subject: [PATCH] [TableGen] Record::checkRecordAssertions() - Use const-ref iterator in for-range loop. NFCI. Avoid unnecessary copies, reported by MSVC static analyzer. --- llvm/lib/TableGen/Record.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp index 8663863d968f..aee8b853a0d9 100644 --- a/llvm/lib/TableGen/Record.cpp +++ b/llvm/lib/TableGen/Record.cpp @@ -2653,7 +2653,7 @@ void Record::checkRecordAssertions() { RecordResolver R(*this); R.setFinal(true); - for (auto Assertion : getAssertions()) { + for (const auto &Assertion : getAssertions()) { Init *Condition = Assertion.Condition->resolveReferences(R); Init *Message = Assertion.Message->resolveReferences(R); CheckAssert(Assertion.Loc, Condition, Message);