From d0234c4593ad6a59f378317ebcfc0506a1a11c36 Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Sat, 26 Mar 2016 00:37:55 +0000 Subject: [PATCH] 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. llvm-svn: 264485 --- lldb/source/Symbol/ClangASTImporter.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lldb/source/Symbol/ClangASTImporter.cpp b/lldb/source/Symbol/ClangASTImporter.cpp index 6a3ae65..17d2820 100644 --- a/lldb/source/Symbol/ClangASTImporter.cpp +++ b/lldb/source/Symbol/ClangASTImporter.cpp @@ -729,8 +729,13 @@ ClangASTImporter::Minion::ExecuteDeportWorkQueues () if (TagDecl *tag_decl = dyn_cast(decl)) { if (TagDecl *original_tag_decl = dyn_cast(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::ImportDefinitionTo (clang::Decl *to, clang::Decl *from { ASTImporter::Imported(from, to); - ObjCInterfaceDecl *to_objc_interface = dyn_cast(to); - /* if (to_objc_interface) to_objc_interface->startDefinition(); @@ -766,12 +769,20 @@ ClangASTImporter::Minion::ImportDefinitionTo (clang::Decl *to, clang::Decl *from */ ImportDefinition(from); + + if (clang::TagDecl *to_tag = dyn_cast(to)) + { + if (clang::TagDecl *from_tag = dyn_cast(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(to)) { do { -- 2.7.4