clang 20.0.0git
|
BugReporterVisitors are used to add custom diagnostics along a path. More...
#include "clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h"
Public Member Functions | |
BugReporterVisitor ()=default | |
BugReporterVisitor (const BugReporterVisitor &)=default | |
BugReporterVisitor (BugReporterVisitor &&) | |
BugReporterVisitor & | operator= (const BugReporterVisitor &)=delete |
BugReporterVisitor & | operator= (BugReporterVisitor &&)=delete |
virtual | ~BugReporterVisitor () |
virtual PathDiagnosticPieceRef | VisitNode (const ExplodedNode *Succ, BugReporterContext &BRC, PathSensitiveBugReport &BR)=0 |
Return a diagnostic piece which should be associated with the given node. | |
virtual void | finalizeVisitor (BugReporterContext &BRC, const ExplodedNode *EndPathNode, PathSensitiveBugReport &BR) |
Last function called on the visitor, no further calls to VisitNode would follow. | |
virtual PathDiagnosticPieceRef | getEndPath (BugReporterContext &BRC, const ExplodedNode *N, PathSensitiveBugReport &BR) |
Provide custom definition for the final diagnostic piece on the path - the piece, which is displayed before the path is expanded. | |
virtual void | Profile (llvm::FoldingSetNodeID &ID) const =0 |
Static Public Member Functions | |
static PathDiagnosticPieceRef | getDefaultEndPath (const BugReporterContext &BRC, const ExplodedNode *N, const PathSensitiveBugReport &BR) |
Generates the default final diagnostic piece. | |
BugReporterVisitors are used to add custom diagnostics along a path.
Definition at line 49 of file BugReporterVisitors.h.
|
default |
|
default |
|
inline |
Definition at line 53 of file BugReporterVisitors.h.
|
virtualdefault |
|
virtual |
Last function called on the visitor, no further calls to VisitNode would follow.
Reimplemented in clang::ento::Z3CrosscheckVisitor, and clang::ento::LikelyFalsePositiveSuppressionBRVisitor.
Definition at line 359 of file BugReporterVisitors.cpp.
|
static |
Generates the default final diagnostic piece.
Definition at line 364 of file BugReporterVisitors.cpp.
References clang::ento::BugReport::getDescription(), clang::ento::PathSensitiveBugReport::getLocation(), clang::ento::PathSensitiveBugReport::getRanges(), and P.
Referenced by clang::ento::retaincountchecker::RefCountReportVisitor::getEndPath().
|
virtual |
Provide custom definition for the final diagnostic piece on the path - the piece, which is displayed before the path is expanded.
NOTE that this function can be implemented on at most one used visitor, and otherwise it crahes at runtime.
Reimplemented in clang::ento::retaincountchecker::RefCountReportVisitor, and clang::ento::retaincountchecker::RefLeakReportVisitor.
Definition at line 353 of file BugReporterVisitors.cpp.
|
delete |
|
delete |
|
pure virtual |
Implemented in clang::ento::TrackConstraintBRVisitor, clang::ento::NilReceiverBRVisitor, clang::ento::ConditionBRVisitor, clang::ento::LikelyFalsePositiveSuppressionBRVisitor, clang::ento::UndefOrNullArgVisitor, clang::ento::SuppressInlineDefensiveChecksVisitor, clang::ento::TagVisitor, clang::ento::Z3CrosscheckVisitor, clang::ento::NoOwnershipChangeVisitor, and clang::ento::retaincountchecker::RefCountReportVisitor.
Referenced by REGISTER_MAP_WITH_PROGRAMSTATE().
|
pure virtual |
Return a diagnostic piece which should be associated with the given node.
Note that this function does not get run on the very last node of the report, as the PathDiagnosticPiece associated with the last node should be unique. Use getEndPath to customize the note associated with the report end instead.
The last parameter can be used to register a new visitor with the given BugReport while processing a node.
Implemented in clang::ento::LikelyFalsePositiveSuppressionBRVisitor, clang::ento::NoStateChangeFuncVisitor, clang::ento::TrackConstraintBRVisitor, clang::ento::NilReceiverBRVisitor, clang::ento::ConditionBRVisitor, clang::ento::UndefOrNullArgVisitor, clang::ento::Z3CrosscheckVisitor, clang::ento::retaincountchecker::RefCountReportVisitor, clang::ento::TagVisitor, and clang::ento::SuppressInlineDefensiveChecksVisitor.
Referenced by REGISTER_MAP_WITH_PROGRAMSTATE().