[cfe-commits] r120773 - in /cfe/trunk/lib/Checker: AnalysisConsumer.cpp TextPathDiagnostics.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Thu Dec 2 17:17:19 PST 2010


Author: akirtzidis
Date: Thu Dec  2 19:17:19 2010
New Revision: 120773

URL: http://llvm.org/viewvc/llvm-project?rev=120773&view=rev
Log:
Remove leftover code and use the text path diagnostic client even without a specified output file since
it just uses diagnostic notes.

Modified:
    cfe/trunk/lib/Checker/AnalysisConsumer.cpp
    cfe/trunk/lib/Checker/TextPathDiagnostics.cpp

Modified: cfe/trunk/lib/Checker/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/AnalysisConsumer.cpp?rev=120773&r1=120772&r2=120773&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/AnalysisConsumer.cpp (original)
+++ cfe/trunk/lib/Checker/AnalysisConsumer.cpp Thu Dec  2 19:17:19 2010
@@ -108,6 +108,10 @@
         case PD_##NAME: PD = CREATEFN(OutDir, PP); break;
 #include "clang/Frontend/Analyses.def"
       }
+    } else if (Opts.AnalysisDiagOpt == PD_TEXT) {
+      // Create the text client even without a specified output file since
+      // it just uses diagnostic notes.
+      PD = createTextPathDiagnosticClient("", PP);
     }
 
     // Create the analyzer component creators.

Modified: cfe/trunk/lib/Checker/TextPathDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/TextPathDiagnostics.cpp?rev=120773&r1=120772&r2=120773&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/TextPathDiagnostics.cpp (original)
+++ cfe/trunk/lib/Checker/TextPathDiagnostics.cpp Thu Dec  2 19:17:19 2010
@@ -20,7 +20,7 @@
 
 namespace {
 
-/// \brief Simple path diagnostic client used for outputting as text
+/// \brief Simple path diagnostic client used for outputting as diagnostic notes
 /// the sequence of events.
 class TextPathDiagnostics : public PathDiagnosticClient {
   const std::string OutputFile;
@@ -61,14 +61,6 @@
     return;
   }
 
-  // Open the file.
-  std::string ErrMsg;
-  llvm::raw_fd_ostream o(OutputFile.c_str(), ErrMsg);
-  if (!ErrMsg.empty()) {
-    llvm::errs() << "warning: could not create file: " << OutputFile << '\n';
-    return;
-  }
-
   for (PathDiagnostic::const_iterator I=D->begin(), E=D->end(); I != E; ++I) {
     if (isa<PathDiagnosticEventPiece>(*I)) {
       PathDiagnosticEventPiece &event = cast<PathDiagnosticEventPiece>(*I);





More information about the cfe-commits mailing list