1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

[TableGen] Use ListSeparator (NFC)

This commit is contained in:
Kazu Hirata 2021-01-31 10:23:41 -08:00
parent 8323f01e46
commit 6bcccfc6ec

View File

@ -414,13 +414,9 @@ void SearchableTableEmitter::emitLookupFunction(const GenericTable &Table,
}
OS << " };\n";
OS << " KeyType Key = {";
bool NeedComma = false;
ListSeparator LS;
for (const auto &Field : Index.Fields) {
if (NeedComma)
OS << ", ";
NeedComma = true;
OS << Field.Name;
OS << LS << Field.Name;
if (isa<StringRecTy>(Field.RecType)) {
OS << ".upper()";
if (IsPrimary)
@ -482,15 +478,10 @@ void SearchableTableEmitter::emitLookupDeclaration(const GenericTable &Table,
raw_ostream &OS) {
OS << "const " << Table.CppTypeName << " *" << Index.Name << "(";
bool NeedComma = false;
for (const auto &Field : Index.Fields) {
if (NeedComma)
OS << ", ";
NeedComma = true;
OS << searchableFieldType(Table, Index, Field, TypeInArgument) << " "
ListSeparator LS;
for (const auto &Field : Index.Fields)
OS << LS << searchableFieldType(Table, Index, Field, TypeInArgument) << " "
<< Field.Name;
}
OS << ")";
}