diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-12-03 01:17:19 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-12-03 01:17:19 +0000 |
| commit | 2fd03a60e42526ac4a6be8e9bde77a3c7b03ff92 (patch) | |
| tree | 05916d76aa238b2c11762cda9b55098e374ab312 /clang/lib/Checker | |
| parent | 6882f800c5b44ff6afa65ac2169c038a38f73e1a (diff) | |
| download | bcm5719-llvm-2fd03a60e42526ac4a6be8e9bde77a3c7b03ff92.tar.gz bcm5719-llvm-2fd03a60e42526ac4a6be8e9bde77a3c7b03ff92.zip | |
Remove leftover code and use the text path diagnostic client even without a specified output file since
it just uses diagnostic notes.
llvm-svn: 120773
Diffstat (limited to 'clang/lib/Checker')
| -rw-r--r-- | clang/lib/Checker/AnalysisConsumer.cpp | 4 | ||||
| -rw-r--r-- | clang/lib/Checker/TextPathDiagnostics.cpp | 10 |
2 files changed, 5 insertions, 9 deletions
diff --git a/clang/lib/Checker/AnalysisConsumer.cpp b/clang/lib/Checker/AnalysisConsumer.cpp index 47dd7fa186d..52dd0680346 100644 --- a/clang/lib/Checker/AnalysisConsumer.cpp +++ b/clang/lib/Checker/AnalysisConsumer.cpp @@ -108,6 +108,10 @@ public: 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. diff --git a/clang/lib/Checker/TextPathDiagnostics.cpp b/clang/lib/Checker/TextPathDiagnostics.cpp index 03c6088027a..83ff7a4409b 100644 --- a/clang/lib/Checker/TextPathDiagnostics.cpp +++ b/clang/lib/Checker/TextPathDiagnostics.cpp @@ -20,7 +20,7 @@ using namespace llvm; 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 @@ void TextPathDiagnostics::HandlePathDiagnostic(const PathDiagnostic* D) { 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); |

