diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -1530,7 +1530,6 @@ return type_sp; SymbolFileDWARF *dwarf = die.GetDWARF(); - TypeList &type_list = dwarf->GetTypeList(); DWARFDIE sc_parent_die = SymbolFileDWARF::GetParentSymbolContextDIE(die); dw_tag_t sc_parent_tag = sc_parent_die.Tag(); @@ -1550,10 +1549,6 @@ if (symbol_context_scope != nullptr) type_sp->SetSymbolContextScope(symbol_context_scope); - // We are ready to put this type into the uniqued list up at the module - // level. - type_list.Insert(type_sp); - dwarf->GetDIEToType()[die.GetDIE()] = type_sp.get(); return type_sp; } diff --git a/lldb/test/Shell/SymbolFile/DWARF/x86/find-basic-type.cpp b/lldb/test/Shell/SymbolFile/DWARF/x86/find-basic-type.cpp --- a/lldb/test/Shell/SymbolFile/DWARF/x86/find-basic-type.cpp +++ b/lldb/test/Shell/SymbolFile/DWARF/x86/find-basic-type.cpp @@ -8,6 +8,7 @@ // RUN: FileCheck --check-prefix=CONTEXT %s // RUN: lldb-test symbols --name=not_there --find=type %t | \ // RUN: FileCheck --check-prefix=EMPTY %s +// RUN: lldb-test symbols --find=none %t | FileCheck --check-prefix=TYPES %s // // RUN: %clang %s -g -c -o %t --target=x86_64-apple-macosx // RUN: lldb-test symbols --name=foo --find=type %t | \ @@ -16,6 +17,7 @@ // RUN: FileCheck --check-prefix=CONTEXT %s // RUN: lldb-test symbols --name=not_there --find=type %t | \ // RUN: FileCheck --check-prefix=EMPTY %s +// RUN: lldb-test symbols --find=none %t | FileCheck --check-prefix=TYPES %s // RUN: %clang %s -c -o %t.o --target=x86_64-pc-linux -gdwarf-5 -gpubnames // RUN: ld.lld %t.o -o %t @@ -26,6 +28,7 @@ // RUN: FileCheck --check-prefix=CONTEXT %s // RUN: lldb-test symbols --name=not_there --find=type %t | \ // RUN: FileCheck --check-prefix=EMPTY %s +// RUN: lldb-test symbols --find=none %t | FileCheck --check-prefix=TYPES %s // NAMES: Name: .debug_names @@ -34,25 +37,32 @@ // CONTEXT: Found 1 types: struct foo { }; // NAME-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-1]] +// TYPES: name = "foo", size = 1, decl = find-basic-type.cpp:[[@LINE-2]] namespace bar { int context; struct foo {}; // NAME-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-1]] // CONTEXT-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-2]] +// TYPES: name = "foo", size = 1, decl = find-basic-type.cpp:[[@LINE-3]] namespace baz { struct foo {}; // NAME-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-1]] +// TYPES: name = "foo", size = 1, decl = find-basic-type.cpp:[[@LINE-2]] } } struct sbar { + // TYPES: name = "sbar", size = 1, decl = find-basic-type.cpp:[[@LINE-1]] struct foo {}; -// NAME-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-1]] + // NAME-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-1]] + // TYPES: name = "foo", size = 1, decl = find-basic-type.cpp:[[@LINE-2]] }; struct foobar {}; +// TYPES: name = "foobar", size = 1, decl = find-basic-type.cpp:[[@LINE-1]] struct Foo {}; +// TYPES: name = "Foo", size = 1, decl = find-basic-type.cpp:[[@LINE-1]] extern "C" void _start(foo, bar::foo, bar::baz::foo, sbar::foo, foobar, Foo) {}