[PATCH] D26455: Handle non-inlined clang::Type::getAs specializations in extract_symbols.py

Stephan Bergmann via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 14 09:17:07 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL286841: Handle non-inlined clang::Type::getAs specializations in extract_symbols.py (authored by sberg).

Changed prior to commit:
  https://reviews.llvm.org/D26455?vs=77807&id=77824#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D26455

Files:
  llvm/trunk/utils/extract_symbols.py


Index: llvm/trunk/utils/extract_symbols.py
===================================================================
--- llvm/trunk/utils/extract_symbols.py
+++ llvm/trunk/utils/extract_symbols.py
@@ -128,8 +128,12 @@
             if match:
                 return match.group(1)
         return symbol
-    # Function template instantiations start with ?$, discard them as it's
-    # assumed that the definition is public
+    # Function template instantiations start with ?$; keep the instantiations of
+    # clang::Type::getAs, as some of them are explipict specializations that are
+    # defined in clang's lib/AST/Type.cpp; discard the rest as it's assumed that
+    # the definition is public
+    elif re.match('\?\?\$getAs at .+@Type at clang@@', symbol):
+        return symbol
     elif symbol.startswith('??$'):
         return None
     # Deleting destructors start with ?_G or ?_E and can be discarded because
@@ -195,8 +199,12 @@
     # defined in headers and not required to be kept
     if re.match('[CD][123]', names[-1][0]) and names[-2][1]:
         return None
-    # Discard function template instantiations as it's assumed that the
-    # definition is public
+    # Keep the instantiations of clang::Type::getAs, as some of them are
+    # explipict specializations that are defined in clang's lib/AST/Type.cpp;
+    # discard any other function template instantiations as it's assumed that
+    # the definition is public
+    elif symbol.startswith('_ZNK5clang4Type5getAs'):
+        return symbol
     elif names[-1][1]:
         return None
     # Keep llvm:: and clang:: names


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26455.77824.patch
Type: text/x-patch
Size: 1596 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161114/204b5551/attachment.bin>


More information about the llvm-commits mailing list