diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-11-13 03:14:14 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-11-13 03:14:14 +0000 |
commit | 179ce89c6058688a0accec9ac53dbdf7fc50b78b (patch) | |
tree | 27891df2a852e358061f38c479e974c088184e33 /lib/Frontend/PlistDiagnostics.cpp | |
parent | cca5e1ea18e40dd17e25c0fa9d64a5bc6f34a36a (diff) |
Only flush plist diagnostics once.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87073 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PlistDiagnostics.cpp')
-rw-r--r-- | lib/Frontend/PlistDiagnostics.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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<PathDiagnosticClient> 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<std::string> *FilesMade) { + + if (flushed) + return; + + flushed = true; // Build up a set of FIDs that we use by scanning the locations and // ranges of the diagnostics. |