[llvm] [NFC] mark DebugCounter::Chunk methods as const (PR #143039)

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 5 14:50:53 PDT 2025


https://github.com/fmayer created https://github.com/llvm/llvm-project/pull/143039

None

>From 7d344e79a52573a34788137f33e91208fe91fcca Mon Sep 17 00:00:00 2001
From: Florian Mayer <fmayer at google.com>
Date: Thu, 5 Jun 2025 14:50:39 -0700
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
 =?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.4
---
 llvm/include/llvm/Support/DebugCounter.h | 4 ++--
 llvm/lib/Support/DebugCounter.cpp        | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/Support/DebugCounter.h b/llvm/include/llvm/Support/DebugCounter.h
index 9611586a92c3b..092601daed585 100644
--- a/llvm/include/llvm/Support/DebugCounter.h
+++ b/llvm/include/llvm/Support/DebugCounter.h
@@ -59,8 +59,8 @@ class DebugCounter {
   struct Chunk {
     int64_t Begin;
     int64_t End;
-    LLVM_ABI void print(llvm::raw_ostream &OS);
-    bool contains(int64_t Idx) { return Idx >= Begin && Idx <= End; }
+    LLVM_ABI void print(llvm::raw_ostream &OS) const;
+    bool contains(int64_t Idx) const { return Idx >= Begin && Idx <= End; }
   };
 
   LLVM_ABI static void printChunks(raw_ostream &OS, ArrayRef<Chunk>);
diff --git a/llvm/lib/Support/DebugCounter.cpp b/llvm/lib/Support/DebugCounter.cpp
index 9c4a4429ca0ee..c9c75c674e0fb 100644
--- a/llvm/lib/Support/DebugCounter.cpp
+++ b/llvm/lib/Support/DebugCounter.cpp
@@ -9,7 +9,7 @@ using namespace llvm;
 
 namespace llvm {
 
-void DebugCounter::Chunk::print(llvm::raw_ostream &OS) {
+void DebugCounter::Chunk::print(llvm::raw_ostream &OS) const {
   if (Begin == End)
     OS << Begin;
   else



More information about the llvm-commits mailing list