[llvm] 48cd22c - [NFC] simplify LowerAllowCheckPass::printPipeline (#149374)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 17 12:54:59 PDT 2025


Author: Florian Mayer
Date: 2025-07-17T12:54:56-07:00
New Revision: 48cd22c5661ea454f4ff189c21a8f01c426eb1aa

URL: https://github.com/llvm/llvm-project/commit/48cd22c5661ea454f4ff189c21a8f01c426eb1aa
DIFF: https://github.com/llvm/llvm-project/commit/48cd22c5661ea454f4ff189c21a8f01c426eb1aa.diff

LOG: [NFC] simplify LowerAllowCheckPass::printPipeline (#149374)

Added: 
    

Modified: 
    llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp

Removed: 
    


################################################################################
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 << '>';
 }


        


More information about the llvm-commits mailing list