[llvm-branch-commits] [cfe-tag] r87077 - in /cfe/tags/Apple/clang/clang/tools/clang/lib/Frontend: HTMLDiagnostics.cpp PlistDiagnostics.cpp

Ted Kremenek kremenek at apple.com
Thu Nov 12 19:47:33 PST 2009


Author: kremenek
Date: Thu Nov 12 21:47:33 2009
New Revision: 87077

URL: http://llvm.org/viewvc/llvm-project?rev=87077&view=rev
Log:
Merge in 87072 and 87073.

Modified:
    cfe/tags/Apple/clang/clang/tools/clang/lib/Frontend/HTMLDiagnostics.cpp
    cfe/tags/Apple/clang/clang/tools/clang/lib/Frontend/PlistDiagnostics.cpp

Modified: cfe/tags/Apple/clang/clang/tools/clang/lib/Frontend/HTMLDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/tags/Apple/clang/clang/tools/clang/lib/Frontend/HTMLDiagnostics.cpp?rev=87077&r1=87076&r2=87077&view=diff

==============================================================================
--- cfe/tags/Apple/clang/clang/tools/clang/lib/Frontend/HTMLDiagnostics.cpp (original)
+++ cfe/tags/Apple/clang/clang/tools/clang/lib/Frontend/HTMLDiagnostics.cpp Thu Nov 12 21:47:33 2009
@@ -109,6 +109,8 @@
     ReportDiag(*D, FilesMade);
     delete D;
   }
+  
+  BatchedDiags.clear();
 }
 
 void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D,

Modified: cfe/tags/Apple/clang/clang/tools/clang/lib/Frontend/PlistDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/tags/Apple/clang/clang/tools/clang/lib/Frontend/PlistDiagnostics.cpp?rev=87077&r1=87076&r2=87077&view=diff

==============================================================================
--- cfe/tags/Apple/clang/clang/tools/clang/lib/Frontend/PlistDiagnostics.cpp (original)
+++ cfe/tags/Apple/clang/clang/tools/clang/lib/Frontend/PlistDiagnostics.cpp Thu Nov 12 21:47:33 2009
@@ -37,6 +37,7 @@
     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 @@
 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::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.
@@ -423,4 +429,6 @@
   
   if (FilesMade)
     FilesMade->push_back(OutputFile);
+  
+  BatchedDiags.clear();
 }





More information about the llvm-branch-commits mailing list