Use the DWARF linkage name when importing C++ methods.
authorDavide Italiano <davide@freebsd.org>
Tue, 27 Mar 2018 19:40:50 +0000 (19:40 +0000)
committerDavide Italiano <davide@freebsd.org>
Tue, 27 Mar 2018 19:40:50 +0000 (19:40 +0000)
commit675767a5910d2ec77ef8b51c78fe312cf9022896
treec4b7536fb489cb29b04656541fe0971f1c81ca14
parentb130ea5605531640d84753c16b9ad9cab6baa499
Use the DWARF linkage name when importing C++ methods.

When importing C++ methods into clang AST nodes from the DWARF symbol
table, preserve the DW_AT_linkage_name and use it as the linker
("asm") name for the symbol.

Concretely, this enables `expression` to call into names that use the
GNU `abi_tag` extension, and enables lldb to call into code using
std::string or std::list from recent versions of libstdc++. See
https://bugs.llvm.org/show_bug.cgi?id=35310 . It also seems broadly
more robust than relying on the DWARF->clang->codegen pipeline to
roundtrip properly, but I'm not immediately aware of any other cases
in which it makes a difference.

Patch by Nelson Elhage!

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

llvm-svn: 328658
lldb/include/lldb/Symbol/ClangASTContext.h
lldb/packages/Python/lldbsuite/test/expression_command/pr35310/Makefile [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/expression_command/pr35310/TestExprsBug35310.py [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/expression_command/pr35310/main.cpp [new file with mode: 0644]
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/source/Symbol/ClangASTContext.cpp