aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ChainedIncludesSource.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2011-03-31 19:29:18 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2011-03-31 19:29:18 +0000
commit0ab547c284285e8abc31b30ded2226eb78c2af3b (patch)
tree2623a5afa04001a64c9634eb59cd8f171f71e4ce /lib/Serialization/ChainedIncludesSource.cpp
parent4035580e3475db9013f335ce2b8a49dd1988a79a (diff)
Tell the diagnostic client about starting and ending source files when automatically creating chained PCHs. This way, we don't get a crash whenever a diagnostic is emitted while processing the include.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128663 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ChainedIncludesSource.cpp')
-rw-r--r--lib/Serialization/ChainedIncludesSource.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Serialization/ChainedIncludesSource.cpp b/lib/Serialization/ChainedIncludesSource.cpp
index 56174c1629..aba1eae3d3 100644
--- a/lib/Serialization/ChainedIncludesSource.cpp
+++ b/lib/Serialization/ChainedIncludesSource.cpp
@@ -94,6 +94,8 @@ ChainedIncludesSource *ChainedIncludesSource::create(CompilerInstance &CI) {
Clang->createFileManager();
Clang->createSourceManager(Clang->getFileManager());
Clang->createPreprocessor();
+ Clang->getDiagnosticClient().BeginSourceFile(Clang->getLangOpts(),
+ &Clang->getPreprocessor());
Clang->createASTContext();
llvm::SmallVector<char, 256> serialAST;
@@ -136,6 +138,7 @@ ChainedIncludesSource *ChainedIncludesSource::create(CompilerInstance &CI) {
ParseAST(Clang->getSema());
OS.flush();
+ Clang->getDiagnosticClient().EndSourceFile();
serialBufs.push_back(
llvm::MemoryBuffer::getMemBufferCopy(llvm::StringRef(serialAST.data(),
serialAST.size())));