Skip to content

Commit 8e9fb84

Browse files
committed
[lldb] Also set owning module for template specializations
Summary: This was originally commented out as it broke the data-formatter-stl/libcxx/ tests. However this was fixed by commit ef423a3 (Add Objective-C property accessors loaded from Clang module DWARF to lookup) which sets the HasExternalVisibleStorage flag for the template specializations. Reviewers: aprantl Reviewed By: aprantl Subscribers: abidh, JDevlieghere Differential Revision: https://reviews.llvm.org/D79168
1 parent ff66919 commit 8e9fb84

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,15 +1563,7 @@ TypeSystemClang::CreateClassTemplateSpecializationDecl(
15631563
ast.getTypeDeclType(class_template_specialization_decl, nullptr);
15641564
class_template_specialization_decl->setDeclName(
15651565
class_template_decl->getDeclName());
1566-
// FIXME: Turning this on breaks the libcxx data formatter tests.
1567-
// SetOwningModule marks the Decl as external, which prevents a
1568-
// LookupPtr from being built. Template instantiations can also not
1569-
// be found by ExternalASTSource::FindExternalVisibleDeclsByName(),
1570-
// nor can we lazily build a LookupPtr later, because template
1571-
// specializations are supposed to be hidden so
1572-
// makeDeclVisibleInContextWithFlags() is a noop, as well.
1573-
//
1574-
// SetOwningModule(class_template_specialization_decl, owning_module);
1566+
SetOwningModule(class_template_specialization_decl, owning_module);
15751567
decl_ctx->addDecl(class_template_specialization_decl);
15761568

15771569
class_template_specialization_decl->setSpecializationKind(

lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ @implementation SomeClass {
5252

5353
// Template specializations are not yet supported, so they lack the ownership info:
5454
Template<int> t2;
55-
// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} struct Template
55+
// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} imported in A struct Template
5656

5757
Namespace::InNamespace<int> t3;
58-
// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} struct InNamespace
58+
// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} imported in A struct InNamespace
5959

6060
Namespace::AlsoInNamespace<int> t4;
61-
// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} struct AlsoInNamespace
61+
// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} imported in A.B struct AlsoInNamespace

0 commit comments

Comments
 (0)