Fixed a problem in the Clang AST importer where

we overrode debug information as the authoritative
source for type information, substituting types
from the Objective-C runtime.  The runtime should
never be the primary source.

<rdar://problem/16065049>

llvm-svn: 214583
This commit is contained in:
Sean Callanan 2014-08-01 22:42:38 +00:00
parent 7f5755cfac
commit 608fb390a8
1 changed files with 17 additions and 9 deletions

View File

@ -573,13 +573,13 @@ ClangASTImporter::Minion::Imported (clang::Decl *from, clang::Decl *to)
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
lldb::user_id_t user_id = LLDB_INVALID_UID;
ClangASTMetadata *metadata = m_master.GetDeclMetadata(from);
if (metadata)
user_id = metadata->GetUserID();
if (log) if (log)
{ {
lldb::user_id_t user_id;
ClangASTMetadata *metadata = m_master.GetDeclMetadata(from);
if (metadata)
user_id = metadata->GetUserID();
if (NamedDecl *from_named_decl = dyn_cast<clang::NamedDecl>(from)) if (NamedDecl *from_named_decl = dyn_cast<clang::NamedDecl>(from))
{ {
std::string name_string; std::string name_string;
@ -611,8 +611,12 @@ ClangASTImporter::Minion::Imported (clang::Decl *from, clang::Decl *to)
if (origin_iter != origins.end()) if (origin_iter != origins.end())
{ {
to_context_md->m_origins[to] = origin_iter->second; if (to_context_md->m_origins.find(to) == to_context_md->m_origins.end() ||
user_id != LLDB_INVALID_UID)
{
to_context_md->m_origins[to] = origin_iter->second;
}
MinionSP direct_completer = m_master.GetMinion(&to->getASTContext(), origin_iter->second.ctx); MinionSP direct_completer = m_master.GetMinion(&to->getASTContext(), origin_iter->second.ctx);
if (direct_completer.get() != this) if (direct_completer.get() != this)
@ -636,9 +640,13 @@ ClangASTImporter::Minion::Imported (clang::Decl *from, clang::Decl *to)
if (!m_decls_already_deported->count(to_named_decl)) if (!m_decls_already_deported->count(to_named_decl))
m_decls_to_deport->insert(to_named_decl); m_decls_to_deport->insert(to_named_decl);
} }
} }
to_context_md->m_origins[to] = DeclOrigin(m_source_ctx, from);
if (to_context_md->m_origins.find(to) == to_context_md->m_origins.end() ||
user_id != LLDB_INVALID_UID)
{
to_context_md->m_origins[to] = DeclOrigin(m_source_ctx, from);
}
if (log) if (log)
log->Printf(" [ClangASTImporter] Decl has no origin information in (ASTContext*)%p", log->Printf(" [ClangASTImporter] Decl has no origin information in (ASTContext*)%p",