Install a diagnostic consumer into each new AST

context as the first thing we do.  This prevents
crashes if some of the initial setup produces
messages or errors.

<rdar://problem/20457882>

llvm-svn: 234511
This commit is contained in:
Sean Callanan 2015-04-09 17:42:48 +00:00
parent 628d6057d0
commit 6d61b63cc5
1 changed files with 3 additions and 2 deletions

View File

@ -401,6 +401,9 @@ ClangASTContext::getASTContext()
*getIdentifierTable(),
*getSelectorTable(),
*getBuiltinContext()));
m_ast_ap->getDiagnostics().setClient(getDiagnosticConsumer(), false);
m_ast_ap->InitBuiltinTypes(*getTargetInfo());
if ((m_callback_tag_decl || m_callback_objc_decl) && m_callback_baton)
@ -409,8 +412,6 @@ ClangASTContext::getASTContext()
//m_ast_ap->getTranslationUnitDecl()->setHasExternalVisibleStorage();
}
m_ast_ap->getDiagnostics().setClient(getDiagnosticConsumer(), false);
GetASTMap().Insert(m_ast_ap.get(), this);
}
return m_ast_ap.get();