Skip to content

Commit 0168da3

Browse files
committed
[TableGen] CodeGenMapTable - use for-range loop. NFCI.
1 parent 9761852 commit 0168da3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/utils/TableGen/CodeGenMapTable.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,10 @@ Record *MapTableEmitter::getInstrForColumn(Record *KeyInstr,
318318
ListInit *ColFields = InstrMapDesc.getColFields();
319319
Record *MatchInstr = nullptr;
320320

321-
for (unsigned i = 0, e = RelatedInstrVec.size(); i < e; i++) {
321+
for (llvm::Record *CurInstr : RelatedInstrVec) {
322322
bool MatchFound = true;
323-
Record *CurInstr = RelatedInstrVec[i];
324323
for (unsigned j = 0, endCF = ColFields->size();
325-
(j < endCF) && MatchFound; j++) {
324+
(j < endCF) && MatchFound; j++) {
326325
Init *ColFieldJ = ColFields->getElement(j);
327326
Init *CurInstrInit = CurInstr->getValue(ColFieldJ)->getValue();
328327
std::string CurInstrVal = CurInstrInit->getAsUnquotedString();
@@ -342,8 +341,9 @@ Record *MapTableEmitter::getInstrForColumn(Record *KeyInstr,
342341
}
343342

344343
PrintFatalError("Multiple matches found for `" + KeyInstr->getName() +
345-
"', for the relation `" + InstrMapDesc.getName() + "', row fields [" +
346-
KeyValueStr + "], column `" + CurValueCol->getAsString() + "'");
344+
"', for the relation `" + InstrMapDesc.getName() +
345+
"', row fields [" + KeyValueStr + "], column `" +
346+
CurValueCol->getAsString() + "'");
347347
}
348348
MatchInstr = CurInstr;
349349
}

0 commit comments

Comments
 (0)