[Lldb-commits] [lldb] 8e9fb84 - [lldb] Also set owning module for template specializations

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 30 11:40:35 PDT 2020


Author: Raphael Isemann
Date: 2020-04-30T20:40:13+02:00
New Revision: 8e9fb845fcc42648ffa8c0c5f331f9f2f298bc89

URL: https://github.com/llvm/llvm-project/commit/8e9fb845fcc42648ffa8c0c5f331f9f2f298bc89
DIFF: https://github.com/llvm/llvm-project/commit/8e9fb845fcc42648ffa8c0c5f331f9f2f298bc89.diff

LOG: [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 ef423a3ba57045f80b0fcafce72121449a8b54d4
(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

Added: 
    

Modified: 
    lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
    lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 7acdad2924fb..de1ce9d36b04 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -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(

diff  --git a/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm b/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
index b83797f503cd..f675c3aa8204 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
+++ b/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
@@ -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


        


More information about the lldb-commits mailing list