[llvm] 550d148 - [SandboxIR] Fix warning when building on Windows with clang-cl. NFC.

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 8 11:44:21 PDT 2025


Author: Alexandre Ganea
Date: 2025-04-08T14:40:28-04:00
New Revision: 550d148561002a9984ca57a5ba0ed39367052a52

URL: https://github.com/llvm/llvm-project/commit/550d148561002a9984ca57a5ba0ed39367052a52
DIFF: https://github.com/llvm/llvm-project/commit/550d148561002a9984ca57a5ba0ed39367052a52.diff

LOG: [SandboxIR] Fix warning when building on Windows with clang-cl. NFC.

This fixes several of these:
```
[1151/3381] Building CXX object lib\SandboxIR\CMakeFiles\LLVMSandboxIR.dir\Constant.cpp.obj
C:\git\llvm-project\llvm\lib\SandboxIR\Constant.cpp(331,52): warning: duplicate explicit instantiation of 'operator()' ignored as a Microsoft extension [-Wmicrosoft-template]
  331 |                   llvm::GlobalObject>::LLVMGVToGV::operator()(llvm::GlobalIFunc
      |                                                    ^
C:\git\llvm-project\llvm\include\llvm/SandboxIR/Constant.h(816,52): note: previous explicit instantiation is here
  816 |                   llvm::GlobalObject>::LLVMGVToGV::operator()(llvm::GlobalIFunc
      |                                                    ^
```

Added: 
    

Modified: 
    llvm/lib/SandboxIR/Constant.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/SandboxIR/Constant.cpp b/llvm/lib/SandboxIR/Constant.cpp
index e2b0472bf6b08..a8ed437a8bae3 100644
--- a/llvm/lib/SandboxIR/Constant.cpp
+++ b/llvm/lib/SandboxIR/Constant.cpp
@@ -324,7 +324,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