[llvm] 1b9fbc8 - [extract_symbols.py] Filter out more symbols for MSVC

Sylvestre Ledru via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 12:28:36 PST 2023


Author: Mike Hommey
Date: 2023-01-26T21:28:23+01:00
New Revision: 1b9fbc81ff15f6ad5a0e7f29c486c6edd0bce94c

URL: https://github.com/llvm/llvm-project/commit/1b9fbc81ff15f6ad5a0e7f29c486c6edd0bce94c
DIFF: https://github.com/llvm/llvm-project/commit/1b9fbc81ff15f6ad5a0e7f29c486c6edd0bce94c.diff

LOG: [extract_symbols.py] Filter out more symbols for MSVC

This strips out about 5k symbols.

Fixes https://github.com/llvm/llvm-project/issues/60109

Reviewed By: john.brawn

Differential Revision: https://reviews.llvm.org/D142431

Added: 
    

Modified: 
    llvm/utils/extract_symbols.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/extract_symbols.py b/llvm/utils/extract_symbols.py
index 0f8e8ba64c80..298ee6ba4eeb 100755
--- a/llvm/utils/extract_symbols.py
+++ b/llvm/utils/extract_symbols.py
@@ -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
@@ -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 at 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


        


More information about the llvm-commits mailing list