forked from OSchip/llvm-project
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
This commit is contained in:
parent
6882f800c5
commit
2fd03a60e4
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue