diff --git a/llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp b/llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp index e7a6fa48e9004..55f3239ada100 100644 --- a/llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp +++ b/llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp @@ -10,6 +10,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" +#include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringRef.h" #include "llvm/Analysis/OptimizationRemarkEmitter.h" #include "llvm/Analysis/ProfileSummaryInfo.h" @@ -184,22 +185,14 @@ void LowerAllowCheckPass::printPipeline( // correctness. // TODO: print shorter output by combining adjacent runs, etc. int i = 0; - bool printed = false; + ListSeparator LS(";"); for (unsigned int cutoff : Opts.cutoffs) { - if (cutoff > 0) { - if (printed) - OS << ";"; - OS << "cutoffs[" << i << "]=" << cutoff; - printed = true; - } - + if (cutoff > 0) + OS << LS << "cutoffs[" << i << "]=" << cutoff; i++; } - if (Opts.runtime_check) { - if (printed) - OS << ";"; - OS << "runtime_check=" << Opts.runtime_check; - } + if (Opts.runtime_check) + OS << LS << "runtime_check=" << Opts.runtime_check; OS << '>'; }