From fb720045b0d58911ec2257f340b2208af3591512 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 24 Feb 2026 09:20:56 +0900 Subject: [PATCH] [Windows] Don't hide Type::getAs symbols --- llvm/utils/extract_symbols.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/llvm/utils/extract_symbols.py b/llvm/utils/extract_symbols.py index 5254d16e410d..740d3b5472d1 100755 --- a/llvm/utils/extract_symbols.py +++ b/llvm/utils/extract_symbols.py @@ -101,6 +101,11 @@ def should_keep_microsoft_symbol(symbol, calling_convention_decoration): # because they will be instantiated in the importing translation unit if # needed. elif symbol.startswith("??$"): + # Keep Type::getAs() explicit template specializations. These are + # declared in headers but defined in Type.cpp, so they cannot be + # instantiated locally. Pattern: ??$getAs@@Type@clang@@... + if symbol.startswith("??$getAs@") and "@Type@clang@@" in symbol: + return symbol return None # Delete lambda object constructors and operator() functions. These start # with ??R