[llvm] [ORC] Fix -Wunused-function warning on windows (PR #166207)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 3 10:34:46 PST 2025


https://github.com/bogner created https://github.com/llvm/llvm-project/pull/166207

All of the users of this function are guarded by LLVM_ON_UNIX and LLVM_ENABLE_THREADS ifdefs, so wrap the function itself in these guards as well to avoid the unused function warning.

>From 1806597781b49050d23a8b7767108e7a1b487277 Mon Sep 17 00:00:00 2001
From: Justin Bogner <mail at justinbogner.com>
Date: Thu, 23 Oct 2025 09:39:28 -0700
Subject: [PATCH] [ORC] Fix -Wunused-function warning on windows

All of the users of this function are guarded by LLVM_ON_UNIX and
LLVM_ENABLE_THREADS ifdefs, so wrap the function itself in these guards
as well to avoid the unused function warning.
---
 llvm/tools/llvm-jitlink/llvm-jitlink.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
index 79216e89c7cba..88d6daf08d35e 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
+++ b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
@@ -776,6 +776,7 @@ createSharedMemoryManager(SimpleRemoteEPC &SREPC) {
       SlabSize, SREPC, SAs);
 }
 
+#if LLVM_ON_UNIX && LLVM_ENABLE_THREADS
 static void setupEPCRemoteMemoryManager(SimpleRemoteEPC::Setup &S) {
   switch (UseMemMgr) {
   case MemMgr::Default:
@@ -789,6 +790,7 @@ static void setupEPCRemoteMemoryManager(SimpleRemoteEPC::Setup &S) {
     break;
   }
 }
+#endif
 
 static Expected<MaterializationUnit::Interface>
 getTestObjectFileInterface(Session &S, MemoryBufferRef O) {



More information about the llvm-commits mailing list