Skip to content

Commit fbecbce

Browse files
glandiumCarlosAlbertoEnciso
authored andcommitted
[extract_symbols.py] Filter out more symbols for MSVC
This strips out about 5k symbols. Fixes llvm/llvm-project#60109 Reviewed By: john.brawn Differential Revision: https://reviews.llvm.org/D142431
1 parent 576d227 commit fbecbce

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

llvm/utils/extract_symbols.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ def should_keep_microsoft_symbol(symbol, calling_convention_decoration):
141141
# Remove calling convention decoration from names
142142
match = re.match('[_@]([^@]+)', symbol)
143143
if match:
144-
return match.group(1)
144+
symbol = match.group(1)
145+
# Discard floating point/SIMD constants.
146+
if symbol.startswith(("__xmm@", "__ymm@", "__real@")):
147+
return None
145148
return symbol
146149
# Function template instantiations start with ?$; keep the instantiations of
147150
# clang::Type::getAs, as some of them are explipict specializations that are
@@ -165,6 +168,9 @@ def should_keep_microsoft_symbol(symbol, calling_convention_decoration):
165168
# namespace doesn't exist outside of that translation unit.
166169
elif re.search('\?A(0x\w+)?@', symbol):
167170
return None
171+
# Skip X86GenMnemonicTables functions, they are not exposed from llvm/include/.
172+
elif re.match('\?is[A-Z0-9]*@X86@llvm', symbol):
173+
return None
168174
# Keep mangled llvm:: and clang:: function symbols. How we detect these is a
169175
# bit of a mess and imprecise, but that avoids having to completely demangle
170176
# the symbol name. The outermost namespace is at the end of the identifier

0 commit comments

Comments
 (0)