[Openmp-commits] [openmp] [OpenMP] Remove internal linkage from __kmp_wait template (NFC) (PR #207983)

Aditya Medhane via Openmp-commits openmp-commits at lists.llvm.org
Tue Jul 7 05:12:08 PDT 2026


https://github.com/flash1729 created https://github.com/llvm/llvm-project/pull/207983

__kmp_wait in kmp_dispatch.h is a static function template in a header, so any TU that includes it without instantiating it trips -Wunused-template (kmp_runtime.cpp, kmp_affinity.cpp, kmp_global.cpp, kmp_settings.cpp). It is used by kmp_dispatch.cpp and kmp_dispatch_hier.h. Drop static, which the comment above it already suggests.

Part of #202945

>From 20d458ba4f31bf6d18547a16aa3ced249049cfb9 Mon Sep 17 00:00:00 2001
From: flash1729 <sherlockedaditya at gmail.com>
Date: Tue, 7 Jul 2026 15:31:23 +0530
Subject: [PATCH] [OpenMP] Remove internal linkage from __kmp_wait template
 (NFC)

__kmp_wait in kmp_dispatch.h is a static function template in a header, so
any TU that includes it without instantiating it trips -Wunused-template
(kmp_runtime.cpp, kmp_affinity.cpp, kmp_global.cpp, kmp_settings.cpp). It is
used by kmp_dispatch.cpp and kmp_dispatch_hier.h. Drop static, which the
comment above it already suggests.

Part of #202945.
---
 openmp/runtime/src/kmp_dispatch.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/openmp/runtime/src/kmp_dispatch.h b/openmp/runtime/src/kmp_dispatch.h
index f161a801700f4..1f45bf02c4bcb 100644
--- a/openmp/runtime/src/kmp_dispatch.h
+++ b/openmp/runtime/src/kmp_dispatch.h
@@ -291,8 +291,8 @@ template <typename T> kmp_uint32 __kmp_eq(T value, T checker) {
     TODO: make inline function (move to header file for icl)
 */
 template <typename UT>
-static UT __kmp_wait(volatile UT *spinner, UT checker,
-                     kmp_uint32 (*pred)(UT, UT) USE_ITT_BUILD_ARG(void *obj)) {
+UT __kmp_wait(volatile UT *spinner, UT checker,
+              kmp_uint32 (*pred)(UT, UT) USE_ITT_BUILD_ARG(void *obj)) {
   // note: we may not belong to a team at this point
   volatile UT *spin = spinner;
   UT check = checker;



More information about the Openmp-commits mailing list