clang 22.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< std::unique_ptr< PathDiagnosticConsumer > > | getPathDiagnosticConsumers () |
llvm::iterator_range< EQClasses_iterator > | equivalenceClasses () |
ASTContext & | getContext () |
const SourceManager & | getSourceManager () |
const SourceManager & | getSourceManager () const |
const AnalyzerOptions & | getAnalyzerOptions () |
Preprocessor & | getPreprocessor () |
const Preprocessor & | getPreprocessor () const |
const Decl * | getAnalysisEntryPoint () const |
Get the top-level entry point for the issue to be reported. | |
void | setAnalysisEntryPoint (const Decl *EntryPoint) |
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 CheckerFrontend *Checker, StringRef BugName, StringRef BugCategory, StringRef BugStr, PathDiagnosticLocation Loc, ArrayRef< SourceRange > Ranges={}, ArrayRef< FixItHint > Fixits={}) |
void | EmitBasicReport (const Decl *DeclWithIssue, CheckerNameRef CheckerName, StringRef BugName, StringRef BugCategory, StringRef BugStr, PathDiagnosticLocation Loc, ArrayRef< SourceRange > Ranges={}, ArrayRef< FixItHint > Fixits={}) |
Protected Member Functions | |
virtual std::unique_ptr< DiagnosticForConsumerMapTy > | generateDiagnosticForConsumerMap (BugReport *exampleReport, ArrayRef< std::unique_ptr< 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 586 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 618 of file BugReporter.h.
BugReporter::BugReporter | ( | BugReporterData & | d | ) |
Definition at line 2527 of file BugReporter.cpp.
Referenced by clang::ento::PathSensitiveBugReporter::PathSensitiveBugReporter().
|
virtual |
Definition at line 2530 of file BugReporter.cpp.
void BugReporter::EmitBasicReport | ( | const Decl * | DeclWithIssue, |
CheckerNameRef | CheckerName, | ||
StringRef | BugName, | ||
StringRef | BugCategory, | ||
StringRef | BugStr, | ||
PathDiagnosticLocation | Loc, | ||
ArrayRef< SourceRange > | Ranges = {}, | ||
ArrayRef< FixItHint > | Fixits = {} ) |
Definition at line 3418 of file BugReporter.cpp.
References clang::ento::BugReport::addFixItHint(), clang::ento::BugReport::addRange(), and emitReport().
void BugReporter::EmitBasicReport | ( | const Decl * | DeclWithIssue, |
const CheckerFrontend * | Checker, | ||
StringRef | BugName, | ||
StringRef | BugCategory, | ||
StringRef | BugStr, | ||
PathDiagnosticLocation | Loc, | ||
ArrayRef< SourceRange > | Ranges = {}, | ||
ArrayRef< FixItHint > | Fixits = {} ) |
Definition at line 3408 of file BugReporter.cpp.
References EmitBasicReport(), and clang::ento::CheckerFrontend::getName().
Referenced by checkObjCUnusedIvar(), CompareReturnTypes(), EmitBasicReport(), emitDiagnostics(), emitDiagnostics(), 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 2976 of file BugReporter.cpp.
Referenced by EmitBasicReport(), emitDiagnostics(), emitDiagnosticsUnrelated(), clang::ento::PathSensitiveBugReporter::emitReport(), clang::ento::mpi::MPIBugReporter::reportDoubleNonblocking(), clang::ento::mpi::MPIBugReporter::reportMissingWait(), and clang::ento::mpi::MPIBugReporter::reportUnmatchedWait().
|
inline |
Definition at line 619 of file BugReporter.h.
Referenced by llvm::DOTGraphTraits< ExplodedGraph * >::nodeHasBugReport().
void BugReporter::FlushReports | ( | ) |
Generate and flush diagnostics for all bug reports.
Definition at line 2540 of file BugReporter.cpp.
|
protectedvirtual |
Generate the diagnostics for the given bug report.
Definition at line 3295 of file BugReporter.cpp.
References clang::cast(), and generateDiagnosticForBasicReport().
|
inline |
Get the top-level entry point for the issue to be reported.
Definition at line 634 of file BugReporter.h.
|
inline |
Definition at line 628 of file BugReporter.h.
|
inline |
Definition at line 623 of file BugReporter.h.
Referenced by CheckObjCInstMethSignature().
|
inline |
Definition at line 613 of file BugReporter.h.
|
inline |
Definition at line 630 of file BugReporter.h.
Referenced by clang::ento::CheckerContext::getPreprocessor(), and clang::ento::CheckerContext::getPreprocessor().
|
inline |
Definition at line 631 of file BugReporter.h.
|
inline |
Definition at line 625 of file BugReporter.h.
Referenced by checkObjCUnusedIvar(), CompareReturnTypes(), emitDiagnostics(), emitDiagnostics(), emitDiagnostics(), emitDiagnostics(), emitDiagnosticsUnrelated(), clang::ento::CheckerContext::getSourceManager(), and clang::ento::CheckerContext::getSourceManager().
|
inline |
Definition at line 626 of file BugReporter.h.
|
inline |
Definition at line 636 of file BugReporter.h.