[llvm] TableGen: Fixed the string table definitions visibility. (PR #148946)

Slava Zakharin via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 15 13:53:30 PDT 2025


https://github.com/vzakhari updated https://github.com/llvm/llvm-project/pull/148946

>From 01fc35a3eab939ef7fb366c8288bf8f9e1fc2d64 Mon Sep 17 00:00:00 2001
From: Slava Zakharin <szakharin at nvidia.com>
Date: Tue, 15 Jul 2025 12:48:15 -0700
Subject: [PATCH 1/2] TableGen: Fixed the string table definitions visibility.

This fixes the buildbots issues reported in #148839.
---
 llvm/lib/TableGen/StringToOffsetTable.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/TableGen/StringToOffsetTable.cpp b/llvm/lib/TableGen/StringToOffsetTable.cpp
index d6d2c2590389a..41f82caa12f82 100644
--- a/llvm/lib/TableGen/StringToOffsetTable.cpp
+++ b/llvm/lib/TableGen/StringToOffsetTable.cpp
@@ -83,10 +83,11 @@ void StringToOffsetTable::EmitStringTableDef(raw_ostream &OS,
 #pragma GCC diagnostic pop
 #endif
 
-{1}constexpr llvm::StringTable
+{1} llvm::StringTable
 {2}{0} = {0}Storage;
 )",
-                Name, ClassPrefix.empty() ? "static " : "", ClassPrefix);
+                Name, ClassPrefix.empty() ? "static constexpr" : "const",
+                ClassPrefix);
 }
 
 void StringToOffsetTable::EmitString(raw_ostream &O) const {

>From 55411b835e14a182dcf9ca62ef07b3655a7f8ae1 Mon Sep 17 00:00:00 2001
From: Slava Zakharin <szakharin at nvidia.com>
Date: Tue, 15 Jul 2025 13:53:14 -0700
Subject: [PATCH 2/2] Fixed LIT test.

---
 llvm/test/TableGen/RuntimeLibcallEmitter.td | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/test/TableGen/RuntimeLibcallEmitter.td b/llvm/test/TableGen/RuntimeLibcallEmitter.td
index 2a7da5dede3f6..579e3c7dd62ab 100644
--- a/llvm/test/TableGen/RuntimeLibcallEmitter.td
+++ b/llvm/test/TableGen/RuntimeLibcallEmitter.td
@@ -135,7 +135,7 @@ def BlahLibrary : SystemRuntimeLibrary<isBlahArch, (add calloc, LibraryWithCondi
 // CHECK-NEXT: #pragma GCC diagnostic pop
 // CHECK-NEXT: #endif
 // CHECK-EMPTY:
-// CHECK-NEXT: constexpr llvm::StringTable
+// CHECK-NEXT: const llvm::StringTable
 // CHECK-NEXT: RTLIB::RuntimeLibcallsInfo::RuntimeLibcallImplNameTable = RuntimeLibcallImplNameTableStorage;
 // CHECK-EMPTY:
 // CHECK-NEXT: const uint16_t RTLIB::RuntimeLibcallsInfo::RuntimeLibcallNameOffsetTable[] = {



More information about the llvm-commits mailing list