From 2da5d5dd50c959cfaa14085d3f01d009a4e69011 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Tue, 16 Sep 2025 04:31:16 -0700 Subject: [PATCH] Make NoopStatistic constructor constexpr (NFC) This makes it friendly to -Wglobal-constructors environments. This class is used when Statistics are disabled, the matching class, TrackingStatistic, was made constexpr a while back already in 7e5682ee6201c for other reasons. --- llvm/include/llvm/ADT/Statistic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/ADT/Statistic.h b/llvm/include/llvm/ADT/Statistic.h index 082e6d50577fa..795b0c2082c77 100644 --- a/llvm/include/llvm/ADT/Statistic.h +++ b/llvm/include/llvm/ADT/Statistic.h @@ -131,8 +131,8 @@ class TrackingStatistic { class NoopStatistic { public: - NoopStatistic(const char * /*DebugType*/, const char * /*Name*/, - const char * /*Desc*/) {} + constexpr NoopStatistic(const char * /*DebugType*/, const char * /*Name*/, + const char * /*Desc*/) {} uint64_t getValue() const { return 0; }