From 179ce89c6058688a0accec9ac53dbdf7fc50b78b Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 13 Nov 2009 03:14:14 +0000 Subject: Only flush plist diagnostics once. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87073 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/PlistDiagnostics.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/Frontend/PlistDiagnostics.cpp') diff --git a/lib/Frontend/PlistDiagnostics.cpp b/lib/Frontend/PlistDiagnostics.cpp index 8a12b53534..6bcf39a92a 100644 --- a/lib/Frontend/PlistDiagnostics.cpp +++ b/lib/Frontend/PlistDiagnostics.cpp @@ -37,6 +37,7 @@ namespace { const std::string OutputFile; const LangOptions &LangOpts; llvm::OwningPtr SubPD; + bool flushed; public: PlistDiagnostics(const std::string& prefix, const LangOptions &LangOpts, PathDiagnosticClient *subPD); @@ -61,7 +62,7 @@ namespace { PlistDiagnostics::PlistDiagnostics(const std::string& output, const LangOptions &LO, PathDiagnosticClient *subPD) - : OutputFile(output), LangOpts(LO), SubPD(subPD) {} + : OutputFile(output), LangOpts(LO), SubPD(subPD), flushed(false) {} PathDiagnosticClient* clang::CreatePlistDiagnosticClient(const std::string& s, const Preprocessor &PP, @@ -310,6 +311,11 @@ void PlistDiagnostics::HandlePathDiagnostic(const PathDiagnostic* D) { void PlistDiagnostics::FlushDiagnostics(llvm::SmallVectorImpl *FilesMade) { + + if (flushed) + return; + + flushed = true; // Build up a set of FIDs that we use by scanning the locations and // ranges of the diagnostics. -- cgit v1.2.3-18-g5258