clang 17.0.0git
|
BugReporter is a utility class for generating PathDiagnostics for analysis. More...
#include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
Public Types | |
using | EQClasses_iterator = llvm::FoldingSet< BugReportEquivClass >::iterator |
Iterator over the set of BugReports tracked by the BugReporter. | |
Public Member Functions | |
BugReporter (BugReporterData &d) | |
virtual | ~BugReporter () |
void | FlushReports () |
Generate and flush diagnostics for all bug reports. | |
ArrayRef< PathDiagnosticConsumer * > | getPathDiagnosticConsumers () |
EQClasses_iterator | EQClasses_begin () |
EQClasses_iterator | EQClasses_end () |
ASTContext & | getContext () |
const SourceManager & | getSourceManager () |
const AnalyzerOptions & | getAnalyzerOptions () |
Preprocessor & | getPreprocessor () |
virtual void | emitReport (std::unique_ptr< BugReport > R) |
Add the given report to the set of reports tracked by BugReporter. | |
void | EmitBasicReport (const Decl *DeclWithIssue, const CheckerBase *Checker, StringRef BugName, StringRef BugCategory, StringRef BugStr, PathDiagnosticLocation Loc, ArrayRef< SourceRange > Ranges=std::nullopt, ArrayRef< FixItHint > Fixits=std::nullopt) |
void | EmitBasicReport (const Decl *DeclWithIssue, CheckerNameRef CheckerName, StringRef BugName, StringRef BugCategory, StringRef BugStr, PathDiagnosticLocation Loc, ArrayRef< SourceRange > Ranges=std::nullopt, ArrayRef< FixItHint > Fixits=std::nullopt) |
Protected Member Functions | |
virtual std::unique_ptr< DiagnosticForConsumerMapTy > | generateDiagnosticForConsumerMap (BugReport *exampleReport, ArrayRef< PathDiagnosticConsumer * > consumers, ArrayRef< BugReport * > bugReports) |
Generate the diagnostics for the given bug report. | |
BugReporter is a utility class for generating PathDiagnostics for analysis.
It collects the BugReports and BugTypes and knows how to generate and flush the corresponding diagnostics.
The base class is used for generating path-insensitive
Definition at line 585 of file BugReporter.h.
using clang::ento::BugReporter::EQClasses_iterator = llvm::FoldingSet<BugReportEquivClass>::iterator |
Iterator over the set of BugReports tracked by the BugReporter.
Definition at line 610 of file BugReporter.h.
BugReporter::BugReporter | ( | BugReporterData & | d | ) |
Definition at line 2466 of file BugReporter.cpp.
|
virtual |
Definition at line 2467 of file BugReporter.cpp.
void BugReporter::EmitBasicReport | ( | const Decl * | DeclWithIssue, |
CheckerNameRef | CheckerName, | ||
StringRef | BugName, | ||
StringRef | BugCategory, | ||
StringRef | BugStr, | ||
PathDiagnosticLocation | Loc, | ||
ArrayRef< SourceRange > | Ranges = std::nullopt , |
||
ArrayRef< FixItHint > | Fixits = std::nullopt |
||
) |
Definition at line 3323 of file BugReporter.cpp.
References clang::ento::BugReport::addFixItHint(), clang::ento::BugReport::addRange(), and emitReport().
void BugReporter::EmitBasicReport | ( | const Decl * | DeclWithIssue, |
const CheckerBase * | Checker, | ||
StringRef | BugName, | ||
StringRef | BugCategory, | ||
StringRef | BugStr, | ||
PathDiagnosticLocation | Loc, | ||
ArrayRef< SourceRange > | Ranges = std::nullopt , |
||
ArrayRef< FixItHint > | Fixits = std::nullopt |
||
) |
Definition at line 3313 of file BugReporter.cpp.
References Category, EmitBasicReport(), and clang::ento::CheckerBase::getCheckerName().
Referenced by checkObjCUnusedIvar(), CompareReturnTypes(), EmitBasicReport(), and emitDiagnostics().
|
virtual |
Add the given report to the set of reports tracked by BugReporter.
The reports are usually generated by the checkers. Further, they are folded based on the profile value, which is done to coalesce similar reports.
Reimplemented in clang::ento::PathSensitiveBugReporter.
Definition at line 2896 of file BugReporter.cpp.
Referenced by EmitBasicReport(), clang::ento::CheckerContext::emitReport(), clang::ento::PathSensitiveBugReporter::emitReport(), clang::ento::mpi::MPIBugReporter::reportDoubleNonblocking(), clang::ento::mpi::MPIBugReporter::reportMissingWait(), and clang::ento::mpi::MPIBugReporter::reportUnmatchedWait().
|
inline |
Definition at line 611 of file BugReporter.h.
Referenced by clang::ento::ExprEngine::DumpGraph(), and llvm::DOTGraphTraits< ExplodedGraph * >::nodeHasBugReport().
|
inline |
Definition at line 612 of file BugReporter.h.
Referenced by clang::ento::ExprEngine::DumpGraph(), and llvm::DOTGraphTraits< ExplodedGraph * >::nodeHasBugReport().
void BugReporter::FlushReports | ( | ) |
Generate and flush diagnostics for all bug reports.
Definition at line 2477 of file BugReporter.cpp.
|
protectedvirtual |
Generate the diagnostics for the given bug report.
Definition at line 3199 of file BugReporter.cpp.
References generateDiagnosticForBasicReport().
|
inline |
Definition at line 618 of file BugReporter.h.
References clang::ento::BugReporterData::getAnalyzerOptions().
Referenced by clang::ento::BugReporterContext::getAnalyzerOptions().
|
inline |
Definition at line 614 of file BugReporter.h.
References clang::ento::BugReporterData::getASTContext().
Referenced by CheckObjCInstMethSignature(), and clang::ento::BugReporterContext::getASTContext().
|
inline |
Definition at line 605 of file BugReporter.h.
References clang::ento::BugReporterData::getPathDiagnosticConsumers().
|
inline |
Definition at line 620 of file BugReporter.h.
References clang::ento::BugReporterData::getPreprocessor().
Referenced by clang::ento::CheckerContext::getPreprocessor().
|
inline |
Definition at line 616 of file BugReporter.h.
References clang::ento::BugReporterData::getSourceManager().
Referenced by checkObjCUnusedIvar(), CompareReturnTypes(), emitDiagnostics(), clang::ento::CheckerContext::getSourceManager(), and clang::ento::BugReporterContext::getSourceManager().