[llvm] TableGen: Use StringOffsetTable for RuntimeLibcall names (PR #148839)
Slava Zakharin via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 15 11:30:18 PDT 2025
================
@@ -116,19 +116,40 @@ def BlahLibrary : SystemRuntimeLibrary<isBlahArch, (add calloc, LibraryWithCondi
// CHECK-NEXT: RTLIB::Unsupported
// CHECK-NEXT: };
// CHECK-EMPTY:
-// CHECK-NEXT: const char *const llvm::RTLIB::RuntimeLibcallsInfo::LibCallImplNames[RTLIB::NumLibcallImpls] = {
-// CHECK-NEXT: nullptr, // RTLIB::Unsupported
-// CHECK-NEXT: "___memcpy", // RTLIB::___memcpy
-// CHECK-NEXT: "___memset", // RTLIB::___memset
-// CHECK-NEXT: "__ashlsi3", // RTLIB::__ashlsi3
-// CHECK-NEXT: "__lshrdi3", // RTLIB::__lshrdi3
-// CHECK-NEXT: "bzero", // RTLIB::bzero
-// CHECK-NEXT: "calloc", // RTLIB::calloc
-// CHECK-NEXT: "sqrtl", // RTLIB::sqrtl_f80
-// CHECK-NEXT: "sqrtl", // RTLIB::sqrtl_f128
+// CHECK-EMPTY:
+// CHECK-NEXT: #ifdef __GNUC__
+// CHECK-NEXT: #pragma GCC diagnostic push
+// CHECK-NEXT: #pragma GCC diagnostic ignored "-Woverlength-strings"
+// CHECK-NEXT: #endif
+// CHECK-NEXT: constexpr char RTLIB::RuntimeLibcallsInfo::RuntimeLibcallImplNameTableStorage[] =
+// CHECK-NEXT: "\0"
+// CHECK-NEXT: "___memcpy\0"
+// CHECK-NEXT: "___memset\0"
+// CHECK-NEXT: "__ashlsi3\0"
+// CHECK-NEXT: "__lshrdi3\0"
+// CHECK-NEXT: "bzero\0"
+// CHECK-NEXT: "calloc\0"
+// CHECK-NEXT: "sqrtl\0"
+// CHECK-NEXT: ;
+// CHECK-NEXT: #ifdef __GNUC__
+// CHECK-NEXT: #pragma GCC diagnostic pop
+// CHECK-NEXT: #endif
+// CHECK-EMPTY:
+// CHECK-NEXT: constexpr llvm::StringTable
----------------
vzakhari wrote:
I think this may need to be `extern`, because the `constexpr` variable has internal linkage by default. When built using gcc the `libLLVMCore.a` does not export the symbol.
https://github.com/llvm/llvm-project/pull/148839
More information about the llvm-commits
mailing list