[llvm] [SandboxIR] Don't add dup instantiation for clang (PR #116387)

Jinsong Ji via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 15 06:31:28 PST 2024


https://github.com/jsji created https://github.com/llvm/llvm-project/pull/116387

On Windows some clang-based compiler(eg: icx) also define _MSC_VER


>From abc183443a3e8e687c399993bc383d8025e7a9ef Mon Sep 17 00:00:00 2001
From: Jinsong Ji <jinsong.ji at intel.com>
Date: Fri, 15 Nov 2024 06:28:20 -0800
Subject: [PATCH] [SandboxIR] Don't add dup instantiation for clang

On Windows some clang-based compiler(eg: icx) also define _MSC_VER
---
 llvm/lib/SandboxIR/Constant.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/SandboxIR/Constant.cpp b/llvm/lib/SandboxIR/Constant.cpp
index 3e13c935c42811..f674d7baef3473 100644
--- a/llvm/lib/SandboxIR/Constant.cpp
+++ b/llvm/lib/SandboxIR/Constant.cpp
@@ -302,7 +302,7 @@ template class GlobalWithNodeAPI<GlobalVariable, llvm::GlobalVariable,
 template class GlobalWithNodeAPI<GlobalAlias, llvm::GlobalAlias, GlobalValue,
                                  llvm::GlobalValue>;
 
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && !defined(__clang__)
 // These are needed for SandboxIRTest when building with LLVM_BUILD_LLVM_DYLIB
 template LLVM_EXPORT_TEMPLATE GlobalIFunc &
 GlobalWithNodeAPI<GlobalIFunc, llvm::GlobalIFunc, GlobalObject,



More information about the llvm-commits mailing list