[Lldb-commits] [lldb] r264485 - When we import the definition for a Tagdecl, propagate its completeness too.

Sean Callanan via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 25 17:37:56 PDT 2016


Author: spyffe
Date: Fri Mar 25 19:37:55 2016
New Revision: 264485

URL: http://llvm.org/viewvc/llvm-project?rev=264485&view=rev
Log:
When we import the definition for a Tagdecl, propagate its completeness too.

The ASTImporter completes the full definiton for a TagDecl in several places,
including the type-deport logic.  When this happens, we should also propagate
the bit that says that this is a complete definition.  This makes (for example)
lambdas callable.

<rdar://problem/22864976>

Modified:
    lldb/trunk/source/Symbol/ClangASTImporter.cpp

Modified: lldb/trunk/source/Symbol/ClangASTImporter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTImporter.cpp?rev=264485&r1=264484&r2=264485&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTImporter.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTImporter.cpp Fri Mar 25 19:37:55 2016
@@ -729,8 +729,13 @@ ClangASTImporter::Minion::ExecuteDeportW
         if (TagDecl *tag_decl = dyn_cast<TagDecl>(decl))
         {
             if (TagDecl *original_tag_decl = dyn_cast<TagDecl>(original_decl))
+            {
                 if (original_tag_decl->isCompleteDefinition())
+                {
                     ImportDefinitionTo(tag_decl, original_tag_decl);
+                    tag_decl->setCompleteDefinition(true);
+                }
+            }
             
             tag_decl->setHasExternalLexicalStorage(false);
             tag_decl->setHasExternalVisibleStorage(false);
@@ -753,8 +758,6 @@ ClangASTImporter::Minion::ImportDefiniti
 {
     ASTImporter::Imported(from, to);
 
-    ObjCInterfaceDecl *to_objc_interface = dyn_cast<ObjCInterfaceDecl>(to);
-
     /*
     if (to_objc_interface)
         to_objc_interface->startDefinition();
@@ -766,12 +769,20 @@ ClangASTImporter::Minion::ImportDefiniti
     */
 
     ImportDefinition(from);
+    
+    if (clang::TagDecl *to_tag = dyn_cast<clang::TagDecl>(to))
+    {
+        if (clang::TagDecl *from_tag = dyn_cast<clang::TagDecl>(from))
+        {
+            to_tag->setCompleteDefinition(from_tag->isCompleteDefinition());
+        }
+    }
      
     // If we're dealing with an Objective-C class, ensure that the inheritance has
     // been set up correctly.  The ASTImporter may not do this correctly if the 
     // class was originally sourced from symbols.
     
-    if (to_objc_interface)
+    if (ObjCInterfaceDecl *to_objc_interface = dyn_cast<ObjCInterfaceDecl>(to))
     {
         do
         {




More information about the lldb-commits mailing list