diff options
author | Sean Callanan <scallanan@apple.com> | 2011-12-16 21:06:35 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2011-12-16 21:06:35 +0000 |
commit | bb12004c3855aa233867a042d98dd9cfd780d96d (patch) | |
tree | 09ed7a7c80595461464657c5331a11760f57def7 /lldb/source | |
parent | 300237f00c7ddf9c74de96272f2bb571fda61202 (diff) | |
download | bcm5719-llvm-bb12004c3855aa233867a042d98dd9cfd780d96d.tar.gz bcm5719-llvm-bb12004c3855aa233867a042d98dd9cfd780d96d.zip |
Updated Clang to take an enhancement to the way
we handle Objective-C method calls. Currently,
LLDB treats the result of an Objective-C method
as unknown if the type information doesn't have
the method's signature. Now Clang can cast the
result to id if it isn't explicitly cast.
I also added a test case for this, as well as a
fix for a type import problem that this feature
exposed.
llvm-svn: 146756
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Symbol/ClangASTImporter.cpp | 35 |
2 files changed, 37 insertions, 4 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index 12833caf8c1..e019334a5f7 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -444,9 +444,9 @@ ClangExpressionDeclMap::AddPersistentVariable ASTContext *context(target->GetScratchClangASTContext()->getASTContext()); - TypeFromUser user_type(m_ast_importer->CopyType(context, - parser_type.GetASTContext(), - parser_type.GetOpaqueQualType()), + TypeFromUser user_type(m_ast_importer->DeportType(context, + parser_type.GetASTContext(), + parser_type.GetOpaqueQualType()), context); if (!user_type.GetOpaqueQualType()) diff --git a/lldb/source/Symbol/ClangASTImporter.cpp b/lldb/source/Symbol/ClangASTImporter.cpp index 3bbd9c6af35..2cee0aea035 100644 --- a/lldb/source/Symbol/ClangASTImporter.cpp +++ b/lldb/source/Symbol/ClangASTImporter.cpp @@ -71,6 +71,39 @@ ClangASTImporter::CopyDecl (clang::ASTContext *dst_ast, return NULL; } +lldb::clang_type_t +ClangASTImporter::DeportType (clang::ASTContext *dst_ctx, + clang::ASTContext *src_ctx, + lldb::clang_type_t type) +{ + lldb::clang_type_t result = CopyType(dst_ctx, src_ctx, type); + + if (!result) + return NULL; + + QualType qual_type = QualType::getFromOpaquePtr(type); + + if (const TagType *tag_type = qual_type->getAs<TagType>()) + { + TagDecl *tag_decl = tag_type->getDecl(); + const TagType *result_tag_type = QualType::getFromOpaquePtr(result)->getAs<TagType>(); + TagDecl *result_tag_decl = result_tag_type->getDecl(); + + if (tag_decl) + { + MinionSP minion_sp (GetMinion (dst_ctx, src_ctx)); + + minion_sp->ImportDefinition(tag_decl); + + ASTContextMetadataSP to_context_md = GetContextMetadata(dst_ctx); + + to_context_md->m_origins.erase(result_tag_decl); + } + } + + return result; +} + clang::Decl * ClangASTImporter::DeportDecl (clang::ASTContext *dst_ctx, clang::ASTContext *src_ctx, @@ -398,7 +431,7 @@ clang::Decl if (to_interface_decl->isForwardDecl()) to_interface_decl->completedForwardDecl(); - + to_interface_decl->setExternallyCompleted(); if (log) |