@@ -141,13 +141,9 @@ void EmitInstrDocs(RecordKeeper &RK, raw_ostream &OS) {
141
141
FLAG (isAuthenticated)
142
142
if (!FlagStrings.empty ()) {
143
143
OS << " Flags: " ;
144
- bool IsFirst = true ;
145
- for (auto FlagString : FlagStrings) {
146
- if (!IsFirst)
147
- OS << " , " ;
148
- OS << " ``" << FlagString << " ``" ;
149
- IsFirst = false ;
150
- }
144
+ ListSeparator LS;
145
+ for (auto FlagString : FlagStrings)
146
+ OS << LS << " ``" << FlagString << " ``" ;
151
147
OS << " \n\n " ;
152
148
}
153
149
@@ -192,26 +188,18 @@ void EmitInstrDocs(RecordKeeper &RK, raw_ostream &OS) {
192
188
// Implicit definitions.
193
189
if (!II->ImplicitDefs .empty ()) {
194
190
OS << " Implicit defs: " ;
195
- bool IsFirst = true ;
196
- for (Record *Def : II->ImplicitDefs ) {
197
- if (!IsFirst)
198
- OS << " , " ;
199
- OS << " ``" << Def->getName () << " ``" ;
200
- IsFirst = false ;
201
- }
191
+ ListSeparator LS;
192
+ for (Record *Def : II->ImplicitDefs )
193
+ OS << LS << " ``" << Def->getName () << " ``" ;
202
194
OS << " \n\n " ;
203
195
}
204
196
205
197
// Implicit uses.
206
198
if (!II->ImplicitUses .empty ()) {
207
199
OS << " Implicit uses: " ;
208
- bool IsFirst = true ;
209
- for (Record *Use : II->ImplicitUses ) {
210
- if (!IsFirst)
211
- OS << " , " ;
212
- OS << " ``" << Use->getName () << " ``" ;
213
- IsFirst = false ;
214
- }
200
+ ListSeparator LS;
201
+ for (Record *Use : II->ImplicitUses )
202
+ OS << LS << " ``" << Use->getName () << " ``" ;
215
203
OS << " \n\n " ;
216
204
}
217
205
@@ -220,13 +208,9 @@ void EmitInstrDocs(RecordKeeper &RK, raw_ostream &OS) {
220
208
II->TheDef ->getValueAsListOfDefs (" Predicates" );
221
209
if (!Predicates.empty ()) {
222
210
OS << " Predicates: " ;
223
- bool IsFirst = true ;
224
- for (Record *P : Predicates) {
225
- if (!IsFirst)
226
- OS << " , " ;
227
- OS << " ``" << P->getName () << " ``" ;
228
- IsFirst = false ;
229
- }
211
+ ListSeparator LS;
212
+ for (Record *P : Predicates)
213
+ OS << LS << " ``" << P->getName () << " ``" ;
230
214
OS << " \n\n " ;
231
215
}
232
216
}
0 commit comments