[PATCH] D144017: [Support] Make LLVM_EXTERNAL_VISIBILITY meaningful on Windows

Jun Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 08:07:01 PST 2023


junaire created this revision.
Herald added a project: All.
junaire requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Historically for some reasons LLVM_EXTERNAL_VISIBILITY is a nop on
Windows. This patchs adds support for Windows by marking that as an
alias of __declspec(dllexport).

Signed-off-by: Jun Zhang <jun at junz.org>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144017

Files:
  llvm/include/llvm/Support/Compiler.h


Index: llvm/include/llvm/Support/Compiler.h
===================================================================
--- llvm/include/llvm/Support/Compiler.h
+++ llvm/include/llvm/Support/Compiler.h
@@ -123,8 +123,11 @@
 #define LLVM_EXTERNAL_VISIBILITY
 #endif
 #else
-#define LLVM_LIBRARY_VISIBILITY
+#if defined(_WIN32)
+#define LLVM_EXTERNAL_VISIBILITY __declspec(dllexport)
+#esle
 #define LLVM_EXTERNAL_VISIBILITY
+#define LLVM_LIBRARY_VISIBILITY
 #endif
 
 #if defined(__GNUC__)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144017.497338.patch
Type: text/x-patch
Size: 481 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230214/88980266/attachment.bin>


More information about the llvm-commits mailing list