summaryrefslogtreecommitdiff
path: root/lib/Frontend/ASTMerge.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-13 03:15:25 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-13 03:15:25 +0000
commit914ed9d30e9abf829a62aa996b083b1e47c19ff6 (patch)
treec4b14f63594026cdb22db9e0927c6c7be7027743 /lib/Frontend/ASTMerge.cpp
parent40db2991d746a2901d6441cee261552a20a4a48a (diff)
downloadclang-914ed9d30e9abf829a62aa996b083b1e47c19ff6.tar.gz
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
Diffstat (limited to 'lib/Frontend/ASTMerge.cpp')
-rw-r--r--lib/Frontend/ASTMerge.cpp6
1 files changed, 6 insertions, 0 deletions
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(),