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-01 20:55:07 -08:00
parent ee92719619
commit 8694450fb2

View File

@ -141,13 +141,9 @@ void EmitInstrDocs(RecordKeeper &RK, raw_ostream &OS) {
FLAG(isAuthenticated)
if (!FlagStrings.empty()) {
OS << "Flags: ";
bool IsFirst = true;
for (auto FlagString : FlagStrings) {
if (!IsFirst)
OS << ", ";
OS << "``" << FlagString << "``";
IsFirst = false;
}
ListSeparator LS;
for (auto FlagString : FlagStrings)
OS << LS << "``" << FlagString << "``";
OS << "\n\n";
}
@ -192,26 +188,18 @@ void EmitInstrDocs(RecordKeeper &RK, raw_ostream &OS) {
// Implicit definitions.
if (!II->ImplicitDefs.empty()) {
OS << "Implicit defs: ";
bool IsFirst = true;
for (Record *Def : II->ImplicitDefs) {
if (!IsFirst)
OS << ", ";
OS << "``" << Def->getName() << "``";
IsFirst = false;
}
ListSeparator LS;
for (Record *Def : II->ImplicitDefs)
OS << LS << "``" << Def->getName() << "``";
OS << "\n\n";
}
// Implicit uses.
if (!II->ImplicitUses.empty()) {
OS << "Implicit uses: ";
bool IsFirst = true;
for (Record *Use : II->ImplicitUses) {
if (!IsFirst)
OS << ", ";
OS << "``" << Use->getName() << "``";
IsFirst = false;
}
ListSeparator LS;
for (Record *Use : II->ImplicitUses)
OS << LS << "``" << Use->getName() << "``";
OS << "\n\n";
}
@ -220,13 +208,9 @@ void EmitInstrDocs(RecordKeeper &RK, raw_ostream &OS) {
II->TheDef->getValueAsListOfDefs("Predicates");
if (!Predicates.empty()) {
OS << "Predicates: ";
bool IsFirst = true;
for (Record *P : Predicates) {
if (!IsFirst)
OS << ", ";
OS << "``" << P->getName() << "``";
IsFirst = false;
}
ListSeparator LS;
for (Record *P : Predicates)
OS << LS << "``" << P->getName() << "``";
OS << "\n\n";
}
}