Skip to content

Commit 48cd22c

Browse files
authored
[NFC] simplify LowerAllowCheckPass::printPipeline (#149374)
1 parent a888026 commit 48cd22c

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include "llvm/ADT/SmallVector.h"
1212
#include "llvm/ADT/Statistic.h"
13+
#include "llvm/ADT/StringExtras.h"
1314
#include "llvm/ADT/StringRef.h"
1415
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
1516
#include "llvm/Analysis/ProfileSummaryInfo.h"
@@ -184,22 +185,14 @@ void LowerAllowCheckPass::printPipeline(
184185
// correctness.
185186
// TODO: print shorter output by combining adjacent runs, etc.
186187
int i = 0;
187-
bool printed = false;
188+
ListSeparator LS(";");
188189
for (unsigned int cutoff : Opts.cutoffs) {
189-
if (cutoff > 0) {
190-
if (printed)
191-
OS << ";";
192-
OS << "cutoffs[" << i << "]=" << cutoff;
193-
printed = true;
194-
}
195-
190+
if (cutoff > 0)
191+
OS << LS << "cutoffs[" << i << "]=" << cutoff;
196192
i++;
197193
}
198-
if (Opts.runtime_check) {
199-
if (printed)
200-
OS << ";";
201-
OS << "runtime_check=" << Opts.runtime_check;
202-
}
194+
if (Opts.runtime_check)
195+
OS << LS << "runtime_check=" << Opts.runtime_check;
203196

204197
OS << '>';
205198
}

0 commit comments

Comments
 (0)