r292406 - [ASTUnit] Reset diag state when creating the ASTUnit.
Benjamin Kramer via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 18 08:25:48 PST 2017
Author: d0k
Date: Wed Jan 18 10:25:48 2017
New Revision: 292406
URL: http://llvm.org/viewvc/llvm-project?rev=292406&view=rev
Log:
[ASTUnit] Reset diag state when creating the ASTUnit.
A client could call this with a dirty diagnostic engine, don't crash.
Modified:
cfe/trunk/lib/Frontend/ASTUnit.cpp
Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=292406&r1=292405&r2=292406&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Wed Jan 18 10:25:48 2017
@@ -1879,6 +1879,7 @@ bool ASTUnit::LoadFromCompilerInvocation
// We'll manage file buffers ourselves.
Invocation->getPreprocessorOpts().RetainRemappedFileBuffers = true;
Invocation->getFrontendOpts().DisableFree = false;
+ getDiagnostics().Reset();
ProcessWarningOptions(getDiagnostics(), Invocation->getDiagnosticOpts());
std::unique_ptr<llvm::MemoryBuffer> OverrideMainBuffer;
More information about the cfe-commits
mailing list