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

[TableGen] Use ListSeparator (NFC)

This commit is contained in:
Kazu Hirata 2021-02-08 22:33:51 -08:00
parent cde67518ef
commit 8735641dcd

View File

@ -348,17 +348,13 @@ void SearchableTableEmitter::emitLookupFunction(const GenericTable &Table,
IndexRowsStorage.push_back(Entry.first);
OS << " { ";
bool NeedComma = false;
ListSeparator LS;
for (const auto &Field : Index.Fields) {
if (NeedComma)
OS << ", ";
NeedComma = true;
std::string Repr = primaryRepresentation(
Index.Loc, Field, Entry.first->getValueInit(Field.Name));
if (isa<StringRecTy>(Field.RecType))
Repr = StringRef(Repr).upper();
OS << Repr;
OS << LS << Repr;
}
OS << ", " << Entry.second << " },\n";
}
@ -509,15 +505,11 @@ void SearchableTableEmitter::emitGenericTable(const GenericTable &Table,
Record *Entry = Table.Entries[i];
OS << " { ";
bool NeedComma = false;
for (const auto &Field : Table.Fields) {
if (NeedComma)
OS << ", ";
NeedComma = true;
OS << primaryRepresentation(Table.Locs[0], Field,
ListSeparator LS;
for (const auto &Field : Table.Fields)
OS << LS
<< primaryRepresentation(Table.Locs[0], Field,
Entry->getValueInit(Field.Name));
}
OS << " }, // " << i << "\n";
}