From 914ed9d30e9abf829a62aa996b083b1e47c19ff6 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 13 Aug 2010 03:15:25 +0000 Subject: Teach ASTUnit to hold on to the Sema object and ASTConsumer that are used when parsing (or re-parsing) a file. Also, when loading a precompiled header into ASTUnit, create a Sema object that holds onto semantic-analysis information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111003 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/ASTMerge.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/Frontend/ASTMerge.cpp') diff --git a/lib/Frontend/ASTMerge.cpp b/lib/Frontend/ASTMerge.cpp index e916e20065..cbaa6a3034 100644 --- a/lib/Frontend/ASTMerge.cpp +++ b/lib/Frontend/ASTMerge.cpp @@ -44,6 +44,12 @@ void ASTMergeAction::ExecuteAction() { if (!Unit) continue; + // Reset the argument -> string function so that it has the AST + // context we want, since the Sema object created by + // LoadFromPCHFile will override it. + CI.getDiagnostics().SetArgToStringFn(&FormatASTNodeDiagnosticArgument, + &CI.getASTContext()); + ASTImporter Importer(CI.getDiagnostics(), CI.getASTContext(), CI.getFileManager(), -- cgit v1.2.3-18-g5258