1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

[TableGen] CodeGenMapTable - use for-range loop. NFCI.

This commit is contained in:
Simon Pilgrim 2021-04-16 18:32:56 +01:00
parent 1817354e8a
commit b09cb40a8b

View File

@ -318,11 +318,10 @@ Record *MapTableEmitter::getInstrForColumn(Record *KeyInstr,
ListInit *ColFields = InstrMapDesc.getColFields(); ListInit *ColFields = InstrMapDesc.getColFields();
Record *MatchInstr = nullptr; Record *MatchInstr = nullptr;
for (unsigned i = 0, e = RelatedInstrVec.size(); i < e; i++) { for (llvm::Record *CurInstr : RelatedInstrVec) {
bool MatchFound = true; bool MatchFound = true;
Record *CurInstr = RelatedInstrVec[i];
for (unsigned j = 0, endCF = ColFields->size(); for (unsigned j = 0, endCF = ColFields->size();
(j < endCF) && MatchFound; j++) { (j < endCF) && MatchFound; j++) {
Init *ColFieldJ = ColFields->getElement(j); Init *ColFieldJ = ColFields->getElement(j);
Init *CurInstrInit = CurInstr->getValue(ColFieldJ)->getValue(); Init *CurInstrInit = CurInstr->getValue(ColFieldJ)->getValue();
std::string CurInstrVal = CurInstrInit->getAsUnquotedString(); std::string CurInstrVal = CurInstrInit->getAsUnquotedString();
@ -342,8 +341,9 @@ Record *MapTableEmitter::getInstrForColumn(Record *KeyInstr,
} }
PrintFatalError("Multiple matches found for `" + KeyInstr->getName() + PrintFatalError("Multiple matches found for `" + KeyInstr->getName() +
"', for the relation `" + InstrMapDesc.getName() + "', row fields [" + "', for the relation `" + InstrMapDesc.getName() +
KeyValueStr + "], column `" + CurValueCol->getAsString() + "'"); "', row fields [" + KeyValueStr + "], column `" +
CurValueCol->getAsString() + "'");
} }
MatchInstr = CurInstr; MatchInstr = CurInstr;
} }