[cfe-commits] r128663 - /cfe/trunk/lib/Serialization/ChainedIncludesSource.cpp
Sebastian Redl
sebastian.redl at getdesigned.at
Thu Mar 31 12:29:18 PDT 2011
Author: cornedbee
Date: Thu Mar 31 14:29:18 2011
New Revision: 128663
URL: http://llvm.org/viewvc/llvm-project?rev=128663&view=rev
Log:
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.
Modified:
cfe/trunk/lib/Serialization/ChainedIncludesSource.cpp
Modified: cfe/trunk/lib/Serialization/ChainedIncludesSource.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ChainedIncludesSource.cpp?rev=128663&r1=128662&r2=128663&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ChainedIncludesSource.cpp (original)
+++ cfe/trunk/lib/Serialization/ChainedIncludesSource.cpp Thu Mar 31 14:29:18 2011
@@ -94,6 +94,8 @@
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 @@
ParseAST(Clang->getSema());
OS.flush();
+ Clang->getDiagnosticClient().EndSourceFile();
serialBufs.push_back(
llvm::MemoryBuffer::getMemBufferCopy(llvm::StringRef(serialAST.data(),
serialAST.size())));
More information about the cfe-commits
mailing list