[Lldb-commits] [lldb] r234511 - Install a diagnostic consumer into each new AST

Sean Callanan scallanan at apple.com
Thu Apr 9 10:42:48 PDT 2015


Author: spyffe
Date: Thu Apr  9 12:42:48 2015
New Revision: 234511

URL: http://llvm.org/viewvc/llvm-project?rev=234511&view=rev
Log:
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>

Modified:
    lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=234511&r1=234510&r2=234511&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Thu Apr  9 12:42:48 2015
@@ -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();





More information about the lldb-commits mailing list