[llvm] [ids-check] Add support for ignoring symbols (PR #208241)

Fabrice de Gans via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 08:37:12 PDT 2026


https://github.com/Steelskin created https://github.com/llvm/llvm-project/pull/208241

`llvmGetPassPluginInfo()` is not exported from the LLVM dylib. It is meant to be the entry point for a pass plugin in another dylib. As it is, the ids-check workflow would automatically add the `LLVM_ABI` annotation to it, which is incorrect.

This fixes the issue by explicitly marking the symbol as ignored.

The effort to build LLVM as a DLL is tracked in #109483.

>From 1cc9e5342276ef0af6f2be5e411de11b3a505f4a Mon Sep 17 00:00:00 2001
From: Fabrice de Gans <steelskin at gmail.com>
Date: Wed, 8 Jul 2026 17:35:13 +0200
Subject: [PATCH] [ids-check] Add support for ignoring symbols

`llvmGetPassPluginInfo()` is not exported from the LLVM dylib. It is
meant to be the entry point for a pass plugin in another dylib. As it
is, the ids-check workflow would automatically add the `LLVM_ABI`
annotation to it, which is incorrect.

This fixes the issue by explicitly marking the symbol as ignored.

The effort to build LLVM as a DLL is tracked in #109483.
---
 llvm/include/llvm/Plugins/PassPlugin.h | 5 +++--
 llvm/utils/git/ids-check-helper.py     | 9 +++++++++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/llvm/include/llvm/Plugins/PassPlugin.h b/llvm/include/llvm/Plugins/PassPlugin.h
index 285a2289e0216..e8da9c51c0a85 100644
--- a/llvm/include/llvm/Plugins/PassPlugin.h
+++ b/llvm/include/llvm/Plugins/PassPlugin.h
@@ -133,8 +133,9 @@ class PassPlugin {
 ///   };
 /// }
 /// ```
-extern "C" LLVM_ABI ::llvm::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK
-llvmGetPassPluginInfo();
+extern "C" LLVM_ABI_NOT_EXPORTED ::llvm::PassPluginLibraryInfo
+    LLVM_ATTRIBUTE_WEAK
+    llvmGetPassPluginInfo();
 #ifdef __clang__
 #pragma clang diagnostic pop
 #endif
diff --git a/llvm/utils/git/ids-check-helper.py b/llvm/utils/git/ids-check-helper.py
index 2fc80250cf137..bd6774e842939 100755
--- a/llvm/utils/git/ids-check-helper.py
+++ b/llvm/utils/git/ids-check-helper.py
@@ -34,6 +34,14 @@
 """
 
 
+# Symbols that are ignored by the idt check.
+IGNORED_SYMBOLS = [
+    # The entry point for the pass plugin. It is meant to be defined in another
+    # library and is not exported by LLVM.
+    "llvmGetPassPluginInfo",
+]
+
+
 # Headers we skip outright. Each entry is matched against the changed-file
 # path with `startswith`, so it can be either a directory prefix (trailing /)
 # or a specific file path.
@@ -429,6 +437,7 @@ def fwd(p: str) -> str:
                 fwd(cdb_dir),
                 f"--main-file={donor_path}",
                 f"--export-macro={EXPORT_MACRO[category]}",
+                f"--ignore={','.join(IGNORED_SYMBOLS)}",
                 "--apply-fixits",
                 "--inplace",
             ]



More information about the llvm-commits mailing list