[lldb] Fix simple template names interaction with debug info declarations
authorArthur Eubanks <aeubanks@google.com>
Wed, 23 Nov 2022 22:13:49 +0000 (14:13 -0800)
committerArthur Eubanks <aeubanks@google.com>
Thu, 8 Dec 2022 17:40:43 +0000 (09:40 -0800)
commitc0ac25f1acc4dae97f420cd6bdf1c00c632563f1
tree1e5e400d5bafa564b6b625a3af49d654dc616a63
parent071c39df8632561b599f7b1debd81b3cf6b5b396
[lldb] Fix simple template names interaction with debug info declarations

Without checking template parameters, we would sometimes lookup the
wrong type definition for a type declaration because different
instantiations of the same template class had the same debug info name.

The added GetForwardDeclarationDIETemplateParams() shouldn't need a
cache because we'll cache the results of the declaration -> definition
lookup anyway. (DWARFASTParserClang::ParseStructureLikeDIE()
is_forward_declaration branch)

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D138834
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/test/API/lang/cpp/unique-types3/Makefile [new file with mode: 0644]
lldb/test/API/lang/cpp/unique-types3/TestUniqueTypes3.py [new file with mode: 0644]
lldb/test/API/lang/cpp/unique-types3/a.cpp [new file with mode: 0644]
lldb/test/API/lang/cpp/unique-types3/a.h [new file with mode: 0644]
lldb/test/API/lang/cpp/unique-types3/main.cpp [new file with mode: 0644]