From f2a10ab74ff7ab06b77977be450bec7120ee69b6 Mon Sep 17 00:00:00 2001
From: Mike Hommey <mh@glandium.org>
Date: Wed, 25 Feb 2026 17:45:21 +0900
Subject: [PATCH] [Windows] Adjust exported symbols to filter out dumpColor and
 printPretty (#182964)

Like the dump symbols, these symbols are meant for debugging. This is
enough to get from slightly above 65536 exported symbols to slightly
under 65536 exported symbols.

Cc: @michalpaszkowski, @john-brawn-arm
---
 llvm/utils/extract_symbols.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/llvm/utils/extract_symbols.py b/llvm/utils/extract_symbols.py
index 740d3b5472d1..61e2021f0175 100755
--- a/llvm/utils/extract_symbols.py
+++ b/llvm/utils/extract_symbols.py
@@ -147,9 +147,10 @@ def should_keep_microsoft_symbol(symbol, calling_convention_decoration):
     #                 ::= .*Z (list of types, varargs)
     # <throw-spec> ::= exceptions are not allowed
     elif re.search(r"@(llvm|clang)@@[A-Z][A-Z0-9_]*[A-JQ].+(X|.+@|.*Z)$", symbol):
-        # Remove llvm::<Class>::dump and clang::<Class>::dump methods because
-        # they are used for debugging only.
-        if symbol.startswith("?dump@"):
+        # Remove llvm::<Class>::dump, clang::<Class>::dump,
+        # clang::<Class>::dumpColor, and clang::<Class>::printPretty methods
+        # because they are used for debugging only.
+        if symbol.startswith(("?dump@", "?dumpColor@", "?printPretty@")):
             return None
         return symbol
     # Keep mangled global variables and static class members in llvm:: namespace.
-- 
2.52.0

