]> granicus.if.org Git - clang/commitdiff
Only flush plist diagnostics once.
authorTed Kremenek <kremenek@apple.com>
Fri, 13 Nov 2009 03:14:14 +0000 (03:14 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 13 Nov 2009 03:14:14 +0000 (03:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87073 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/PlistDiagnostics.cpp

index 8a12b5353437c54aea507808f48fc7b07eaf3046..6bcf39a92a240cc1bb3ec6d5ee1dd28dcdf79eca 100644 (file)
@@ -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.