[CodeGen] Use ListSeparator (NFC)

This commit is contained in:
Kazu Hirata 2021-02-17 23:58:43 -08:00
parent fcdef15d77
commit 8e13bbca08
1 changed files with 4 additions and 8 deletions

View File

@ -12,6 +12,7 @@
#include "llvm/CodeGen/GCMetadata.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/CodeGen/GCStrategy.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/IR/Function.h"
@ -122,14 +123,9 @@ bool Printer::runOnFunction(Function &F) {
OS << "\t" << PI->Label->getName() << ": " << "post-call"
<< ", live = {";
for (GCFunctionInfo::live_iterator RI = FD->live_begin(PI),
RE = FD->live_end(PI);
;) {
OS << " " << RI->Num;
if (++RI == RE)
break;
OS << ",";
}
ListSeparator LS(",");
for (const GCRoot &R : make_range(FD->live_begin(PI), FD->live_end(PI)))
OS << LS << " " << R.Num;
OS << " }\n";
}