]> granicus.if.org Git - clang/commitdiff
Finish up the diagnostic client before we've torn down the ASTReader,
authorDouglas Gregor <dgregor@apple.com>
Wed, 9 Feb 2011 18:47:31 +0000 (18:47 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 9 Feb 2011 18:47:31 +0000 (18:47 +0000)
since the diagnostic client might poke at source locations that have
not yet been deserialized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125204 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/FrontendAction.cpp

index af23923002dc32fb730dce5a00a56cf6a7f918dc..e3d8b85941909970feef44ab0a97d65d4b712089 100644 (file)
@@ -290,6 +290,9 @@ void FrontendAction::Execute() {
 void FrontendAction::EndSourceFile() {
   CompilerInstance &CI = getCompilerInstance();
 
+  // Inform the diagnostic client we are done with this source file.
+  CI.getDiagnosticClient().EndSourceFile();
+
   // Finalize the action.
   EndSourceFileAction();
 
@@ -328,9 +331,6 @@ void FrontendAction::EndSourceFile() {
   // an error.
   CI.clearOutputFiles(/*EraseFiles=*/CI.getDiagnostics().hasErrorOccurred());
 
-  // Inform the diagnostic client we are done with this source file.
-  CI.getDiagnosticClient().EndSourceFile();
-
   if (isCurrentFileAST()) {
     CI.takeSema();
     CI.takeASTContext();