From b09cb40a8b32fd909c7cf8ce5f25878af71bcd38 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 16 Apr 2021 18:32:56 +0100 Subject: [PATCH] [TableGen] CodeGenMapTable - use for-range loop. NFCI. --- utils/TableGen/CodeGenMapTable.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utils/TableGen/CodeGenMapTable.cpp b/utils/TableGen/CodeGenMapTable.cpp index 289a20a96f0..6f718acbac3 100644 --- a/utils/TableGen/CodeGenMapTable.cpp +++ b/utils/TableGen/CodeGenMapTable.cpp @@ -318,11 +318,10 @@ Record *MapTableEmitter::getInstrForColumn(Record *KeyInstr, ListInit *ColFields = InstrMapDesc.getColFields(); Record *MatchInstr = nullptr; - for (unsigned i = 0, e = RelatedInstrVec.size(); i < e; i++) { + for (llvm::Record *CurInstr : RelatedInstrVec) { bool MatchFound = true; - Record *CurInstr = RelatedInstrVec[i]; for (unsigned j = 0, endCF = ColFields->size(); - (j < endCF) && MatchFound; j++) { + (j < endCF) && MatchFound; j++) { Init *ColFieldJ = ColFields->getElement(j); Init *CurInstrInit = CurInstr->getValue(ColFieldJ)->getValue(); std::string CurInstrVal = CurInstrInit->getAsUnquotedString(); @@ -342,8 +341,9 @@ Record *MapTableEmitter::getInstrForColumn(Record *KeyInstr, } PrintFatalError("Multiple matches found for `" + KeyInstr->getName() + - "', for the relation `" + InstrMapDesc.getName() + "', row fields [" + - KeyValueStr + "], column `" + CurValueCol->getAsString() + "'"); + "', for the relation `" + InstrMapDesc.getName() + + "', row fields [" + KeyValueStr + "], column `" + + CurValueCol->getAsString() + "'"); } MatchInstr = CurInstr; }