Skip to content

Commit

Permalink
[extract_symbols.py] Filter out more symbols for MSVC
Browse files Browse the repository at this point in the history
This strips out about 5k symbols.

Fixes llvm/llvm-project#60109

Reviewed By: john.brawn

Differential Revision: https://reviews.llvm.org/D142431
  • Loading branch information
glandium authored and CarlosAlbertoEnciso committed Jan 27, 2023
1 parent 576d227 commit fbecbce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion llvm/utils/extract_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ def should_keep_microsoft_symbol(symbol, calling_convention_decoration):
# Remove calling convention decoration from names
match = re.match('[_@]([^@]+)', symbol)
if match:
return match.group(1)
symbol = match.group(1)
# Discard floating point/SIMD constants.
if symbol.startswith(("__xmm@", "__ymm@", "__real@")):
return None
return symbol
# Function template instantiations start with ?$; keep the instantiations of
# clang::Type::getAs, as some of them are explipict specializations that are
Expand All @@ -165,6 +168,9 @@ def should_keep_microsoft_symbol(symbol, calling_convention_decoration):
# namespace doesn't exist outside of that translation unit.
elif re.search('\?A(0x\w+)?@', symbol):
return None
# Skip X86GenMnemonicTables functions, they are not exposed from llvm/include/.
elif re.match('\?is[A-Z0-9]*@X86@llvm', symbol):
return None
# Keep mangled llvm:: and clang:: function symbols. How we detect these is a
# bit of a mess and imprecise, but that avoids having to completely demangle
# the symbol name. The outermost namespace is at the end of the identifier
Expand Down

0 comments on commit fbecbce

Please sign in to comment.