clang API Documentation
#include <BugReporter.h>
Public Types | |
enum | Kind { BaseBRKind, GRBugReporterKind } |
typedef BugTypesTy::iterator | iterator |
Iterator over the set of BugTypes tracked by the BugReporter. | |
typedef llvm::FoldingSet < BugReportEquivClass > ::iterator | EQClasses_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. | |
Kind | getKind () const |
DiagnosticsEngine & | getDiagnostic () |
ArrayRef < PathDiagnosticConsumer * > | getPathDiagnosticConsumers () |
iterator | begin () |
iterator | end () |
EQClasses_iterator | EQClasses_begin () |
EQClasses_iterator | EQClasses_end () |
ASTContext & | getContext () |
SourceManager & | getSourceManager () |
AnalyzerOptions & | getAnalyzerOptions () |
virtual bool | generatePathDiagnostic (PathDiagnostic &pathDiagnostic, PathDiagnosticConsumer &PC, ArrayRef< BugReport * > &bugReports) |
bool | RemoveUnneededCalls (PathPieces &pieces, BugReport *R) |
void | Register (BugType *BT) |
void | emitReport (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=None) |
void | EmitBasicReport (const Decl *DeclWithIssue, CheckName CheckName, StringRef BugName, StringRef BugCategory, StringRef BugStr, PathDiagnosticLocation Loc, ArrayRef< SourceRange > Ranges=None) |
Protected Member Functions | |
BugReporter (BugReporterData &d, Kind k) |
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.
Definition at line 388 of file BugReporter.h.
typedef llvm::FoldingSet<BugReportEquivClass>::iterator clang::ento::BugReporter::EQClasses_iterator |
Iterator over the set of BugReports tracked by the BugReporter.
Definition at line 442 of file BugReporter.h.
typedef BugTypesTy::iterator clang::ento::BugReporter::iterator |
Iterator over the set of BugTypes tracked by the BugReporter.
Definition at line 437 of file BugReporter.h.
Definition at line 390 of file BugReporter.h.
clang::ento::BugReporter::BugReporter | ( | BugReporterData & | d, |
Kind | k | ||
) | [inline, protected] |
Definition at line 415 of file BugReporter.h.
clang::ento::BugReporter::BugReporter | ( | BugReporterData & | d | ) | [inline] |
Definition at line 419 of file BugReporter.h.
BugReporter::~BugReporter | ( | ) | [virtual] |
Definition at line 2747 of file BugReporter.cpp.
iterator clang::ento::BugReporter::begin | ( | ) | [inline] |
Definition at line 438 of file BugReporter.h.
Referenced by clang::ento::ExprEngine::ViewGraph().
void BugReporter::EmitBasicReport | ( | const Decl * | DeclWithIssue, |
const CheckerBase * | Checker, | ||
StringRef | BugName, | ||
StringRef | BugCategory, | ||
StringRef | BugStr, | ||
PathDiagnosticLocation | Loc, | ||
ArrayRef< SourceRange > | Ranges = None |
||
) |
Definition at line 3454 of file BugReporter.cpp.
References clang::ento::CheckerBase::getCheckName(), and clang::ento::BugReport::Ranges.
Referenced by checkObjCDealloc(), checkObjCUnusedIvar(), and CompareReturnTypes().
void BugReporter::EmitBasicReport | ( | const Decl * | DeclWithIssue, |
CheckName | CheckName, | ||
StringRef | BugName, | ||
StringRef | BugCategory, | ||
StringRef | BugStr, | ||
PathDiagnosticLocation | Loc, | ||
ArrayRef< SourceRange > | Ranges = None |
||
) |
Definition at line 3462 of file BugReporter.cpp.
References clang::ento::BugReport::addRange(), clang::ento::BugReport::BugReport(), and clang::ento::BugReport::setDeclWithIssue().
void BugReporter::emitReport | ( | BugReport * | R | ) |
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.
Definition at line 3230 of file BugReporter.cpp.
References clang::ento::BugReport::BT, clang::ento::BugReport::BugReportEquivClass, clang::ento::BugReport::getBugType(), clang::ento::BugReport::getErrorNode(), clang::ento::BugReport::getLocation(), clang::AnalysisDeclContext::isBodyAutosynthesized(), clang::AnalysisDeclContext::isBodyAutosynthesizedFromModelFile(), clang::ento::PathDiagnosticLocation::isValid(), and clang::ento::BugReport::Profile().
Referenced by clang::ento::CheckerContext::emitReport().
iterator clang::ento::BugReporter::end | ( | ) | [inline] |
Definition at line 439 of file BugReporter.h.
Referenced by clang::ento::ExprEngine::ViewGraph().
Definition at line 443 of file BugReporter.h.
Referenced by clang::ento::ExprEngine::ViewGraph().
Definition at line 444 of file BugReporter.h.
Referenced by clang::ento::ExprEngine::ViewGraph().
void BugReporter::FlushReports | ( | ) |
Generate and flush diagnostics for all bug reports.
Definition at line 2758 of file BugReporter.cpp.
Referenced by clang::ento::ExprEngine::~ExprEngine().
virtual bool clang::ento::BugReporter::generatePathDiagnostic | ( | PathDiagnostic & | pathDiagnostic, |
PathDiagnosticConsumer & | PC, | ||
ArrayRef< BugReport * > & | bugReports | ||
) | [inline, virtual] |
Reimplemented in clang::ento::GRBugReporter.
Definition at line 452 of file BugReporter.h.
AnalyzerOptions& clang::ento::BugReporter::getAnalyzerOptions | ( | ) | [inline] |
Definition at line 450 of file BugReporter.h.
References clang::ento::BugReporterData::getAnalyzerOptions().
ASTContext& clang::ento::BugReporter::getContext | ( | ) | [inline] |
Definition at line 446 of file BugReporter.h.
References clang::ento::BugReporterData::getASTContext().
Referenced by checkObjCDealloc(), CheckObjCInstMethSignature(), and clang::ento::BugReporterContext::getASTContext().
DiagnosticsEngine& clang::ento::BugReporter::getDiagnostic | ( | ) | [inline] |
Definition at line 428 of file BugReporter.h.
References clang::ento::BugReporterData::getDiagnostic().
Kind clang::ento::BugReporter::getKind | ( | ) | const [inline] |
Definition at line 426 of file BugReporter.h.
Referenced by clang::ento::GRBugReporter::classof().
ArrayRef<PathDiagnosticConsumer*> clang::ento::BugReporter::getPathDiagnosticConsumers | ( | ) | [inline] |
Definition at line 432 of file BugReporter.h.
References clang::ento::BugReporterData::getPathDiagnosticConsumers().
SourceManager& clang::ento::BugReporter::getSourceManager | ( | ) | [inline] |
Definition at line 448 of file BugReporter.h.
References clang::ento::BugReporterData::getSourceManager().
Referenced by checkObjCDealloc(), checkObjCUnusedIvar(), CompareReturnTypes(), clang::ento::CheckerContext::getSourceManager(), and clang::ento::BugReporterContext::getSourceManager().
void BugReporter::Register | ( | BugType * | BT | ) |
Definition at line 3226 of file BugReporter.cpp.
bool clang::ento::BugReporter::RemoveUnneededCalls | ( | PathPieces & | pieces, |
BugReport * | R | ||
) |