summaryrefslogtreecommitdiffstats
path: root/llvm/utils/extract_symbols.py
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-11-14 17:07:09 +0000
committerStephan Bergmann <sbergman@redhat.com>2016-11-14 17:07:09 +0000
commit06c31f6061e654fd1edf7e91a6c9bb4800e415a9 (patch)
tree497142d32d58ccec5bb052828be5593646990aeb /llvm/utils/extract_symbols.py
parentd5033a4576f8dabf3a4c35d0534aa83dde744098 (diff)
downloadbcm5719-llvm-06c31f6061e654fd1edf7e91a6c9bb4800e415a9.tar.gz
bcm5719-llvm-06c31f6061e654fd1edf7e91a6c9bb4800e415a9.zip
Handle non-inlined clang::Type::getAs specializations in extract_symbols.py
The existing logic was to discard any symbols representing function template instantiations, as the definitions were assumed to be inline. But there are three explicit specializations of clang::Type::getAs that are only defined in Clang's lib/AST/Type.cpp, and at least the plugin used by the LibreOffice build (https://wiki.documentfoundation.org/Development/Clang_plugins) uses those functions. Differential Revision: https://reviews.llvm.org/D26455 llvm-svn: 286841
Diffstat (limited to 'llvm/utils/extract_symbols.py')
-rwxr-xr-xllvm/utils/extract_symbols.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/llvm/utils/extract_symbols.py b/llvm/utils/extract_symbols.py
index 9f467a7d055..96ae24c608e 100755
--- a/llvm/utils/extract_symbols.py
+++ b/llvm/utils/extract_symbols.py
@@ -128,8 +128,12 @@ def should_keep_microsoft_symbol(symbol, calling_convention_decoration):
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@.+@Type@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 @@ def should_keep_itanium_symbol(symbol, calling_convention_decoration):
# 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
OpenPOWER on IntegriCloud