[llvm] [llvm] annotate ABIBreakingChecks symbols for DLL export (PR #149198)
Andrew Rogers via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 22 09:48:54 PDT 2025
================
@@ -12,12 +12,36 @@
#ifndef LLVM_ABI_BREAKING_CHECKS_H
#define LLVM_ABI_BREAKING_CHECKS_H
+// llvm-config.h is required for LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS
+#include "llvm/Config/llvm-config.h"
+
/* Define to enable checks that alter the LLVM C++ ABI */
#cmakedefine01 LLVM_ENABLE_ABI_BREAKING_CHECKS
/* Define to enable reverse iteration of unordered llvm containers */
#cmakedefine01 LLVM_ENABLE_REVERSE_ITERATION
+// Properly annotate EnableABIBreakingChecks or DisableABIBreakingChecks for
+// export from shared library.
+#if !defined(LLVM_ABI_GENERATING_ANNOTATIONS)
+// TODO(https://github.com/llvm/llvm-project/issues/145406): eliminate need for
+// two preprocessor definitions to gate LLVM_ABI macro definitions.
+#if defined(LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS) && !defined(LLVM_BUILD_STATIC)
+#if defined(_WIN32) && !defined(__MINGW32__)
----------------
andrurogerz wrote:
Got it. This is the same logic as I used in `llvm-c/Visibility.h` and is similar to the existing logic in `llvm/Support/Compiler.h`. Would you like me to revise this patch in any way before it gets merged?
> We will need this to look like what I had sketched out originally with explicit cases for the OS
Can you point me to where this is sketched-out? I don't see it in the original discourse or Discord discussion.
https://github.com/llvm/llvm-project/pull/149198
More information about the llvm-commits
mailing list