forked from OSchip/llvm-project
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:
parent
7f5755cfac
commit
608fb390a8
|
@ -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));
|
||||||
|
|
||||||
if (log)
|
lldb::user_id_t user_id = LLDB_INVALID_UID;
|
||||||
{
|
|
||||||
lldb::user_id_t user_id;
|
|
||||||
ClangASTMetadata *metadata = m_master.GetDeclMetadata(from);
|
ClangASTMetadata *metadata = m_master.GetDeclMetadata(from);
|
||||||
if (metadata)
|
if (metadata)
|
||||||
user_id = metadata->GetUserID();
|
user_id = metadata->GetUserID();
|
||||||
|
|
||||||
|
if (log)
|
||||||
|
{
|
||||||
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;
|
||||||
|
@ -610,8 +610,12 @@ ClangASTImporter::Minion::Imported (clang::Decl *from, clang::Decl *to)
|
||||||
OriginMap::iterator origin_iter = origins.find(from);
|
OriginMap::iterator origin_iter = origins.find(from);
|
||||||
|
|
||||||
if (origin_iter != origins.end())
|
if (origin_iter != origins.end())
|
||||||
|
{
|
||||||
|
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;
|
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);
|
||||||
|
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
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",
|
||||||
|
|
Loading…
Reference in New Issue