[llvm] [Support] Use "static constexpr" for a constant in ProcessInfo (NFC) (PR #165192)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 26 20:37:01 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/165192

None

>From 92f87c7970213621a34b078ccce0305d5ab0c696 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 26 Oct 2025 19:21:33 -0700
Subject: [PATCH] [Support] Use "static constexpr" for a constant in
 ProcessInfo (NFC)

---
 llvm/include/llvm/Support/Program.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/include/llvm/Support/Program.h b/llvm/include/llvm/Support/Program.h
index da5685dd0b8b5..53c2e7597b2b4 100644
--- a/llvm/include/llvm/Support/Program.h
+++ b/llvm/include/llvm/Support/Program.h
@@ -45,7 +45,7 @@ typedef procid_t process_t;
 
 /// This struct encapsulates information about a process.
 struct ProcessInfo {
-  enum : procid_t { InvalidPid = 0 };
+  static constexpr procid_t InvalidPid = 0;
 
   procid_t Pid;      /// The process identifier.
   process_t Process; /// Platform-dependent process object.



More information about the llvm-commits mailing list