Skip to content

Commit

Permalink
[lldb] Also set owning module for template specializations
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Teemperor committed Apr 30, 2020
1 parent ff66919 commit 8e9fb84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
10 changes: 1 addition & 9 deletions lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1563,15 +1563,7 @@ TypeSystemClang::CreateClassTemplateSpecializationDecl(
ast.getTypeDeclType(class_template_specialization_decl, nullptr);
class_template_specialization_decl->setDeclName(
class_template_decl->getDeclName());
// FIXME: Turning this on breaks the libcxx data formatter tests.
// SetOwningModule marks the Decl as external, which prevents a
// LookupPtr from being built. Template instantiations can also not
// be found by ExternalASTSource::FindExternalVisibleDeclsByName(),
// nor can we lazily build a LookupPtr later, because template
// specializations are supposed to be hidden so
// makeDeclVisibleInContextWithFlags() is a noop, as well.
//
// SetOwningModule(class_template_specialization_decl, owning_module);
SetOwningModule(class_template_specialization_decl, owning_module);
decl_ctx->addDecl(class_template_specialization_decl);

class_template_specialization_decl->setSpecializationKind(
Expand Down
6 changes: 3 additions & 3 deletions lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ @implementation SomeClass {

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

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

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

0 comments on commit 8e9fb84

Please sign in to comment.