[Lldb-commits] [PATCH] D131335: WIP: [lldb] abi_tag support 3/3 - Use mangle tree API to determine approximate mangled matches

Michael Buch via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 15 02:02:58 PDT 2022


Michael137 added a comment.

As @labath mentioned, we do force clang to preserve the linkage name via `asm()`, but only for class member functions. This was added in `675767a5910d2ec77ef8b51c78fe312cf9022896` (https://reviews.llvm.org/D40283) to also support `abi_tag`! But that didn't cover templates functions:

  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

I tried adding an `AsmLabelAttr` to the `FunctionDecl`s we create when parsing DWARF and it does fix the ABI-tag problem on my small test case. But this only works because the way we create `FunctionTemplateDecl`s is incorrect (as I've described in my previous comments).

So the options are any combination of the following:

1. carry this patch forward (and possibly remove the `asm()` hack for C++ member functions)
2. Add the `asm()` attribute hack to all function declarations
3. Fix the way we generate `FunctionTemplateDecl`s when parsing DWARF (this likely needs a change to DWARF generation)

@aprantl @labath Any preference? I think a 1 and 3 are the more "proper" way to fix this issue


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131335/new/

https://reviews.llvm.org/D131335



More information about the lldb-commits mailing list