[PATCH] D105564: Fix for DWARF parsing to better handle auto return type for member functions

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 7 10:41:30 PDT 2021


shafik created this revision.
shafik added reviewers: aprantl, teemperor, labath.
Herald added a subscriber: arphaman.
shafik requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

Currently when we have a member function that has an auto return type and the definition is out of line we generate two DWARF DIE. 
One for the declaration and a second one for the definition, the definition holds the deduced type but does not contain a DW_AT_name nor
a DW_AT_linkage_name so there was not way to look up the definition DIE.

This fix modifies `CGDebugInfo::CreateCXXMemberFunction` so that it now only emits the linkage name for the definition of a method with a
deduced return type. It also modifies the `DWARFASTParserClang` to detect we have a function with deduced return type and lookup the 
defintion to obtain the correct return type and adjust the `FunctionDecl` to reflect this.

This required modifying the various indexes to support a lookup method for this case similar to `FindCompleteObjCDefinitionTypeForDIE`


https://reviews.llvm.org/D105564

Files:
  clang/lib/CodeGen/CGDebugInfo.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
  lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.h
  lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
  lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/test/Shell/SymbolFile/DWARF/x86/auto_return_appleDwarfIndex.s
  lldb/test/Shell/SymbolFile/DWARF/x86/auto_return_manualDwarfIndex.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105564.356843.patch
Type: text/x-patch
Size: 40406 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210707/1d7d755c/attachment-0001.bin>


More information about the cfe-commits mailing list