clang API Documentation
BugReporterVisitors are used to add custom diagnostics along a path. More...
#include <BugReporterVisitor.h>
Public Member Functions | |
virtual | ~BugReporterVisitor () |
virtual std::unique_ptr < BugReporterVisitor > | clone () const =0 |
Returns a copy of this BugReporter. | |
virtual PathDiagnosticPiece * | VisitNode (const ExplodedNode *Succ, const ExplodedNode *Pred, BugReporterContext &BRC, BugReport &BR)=0 |
Return a diagnostic piece which should be associated with the given node. | |
virtual std::unique_ptr < PathDiagnosticPiece > | getEndPath (BugReporterContext &BRC, const ExplodedNode *N, BugReport &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 std::unique_ptr < PathDiagnosticPiece > | getDefaultEndPath (BugReporterContext &BRC, const ExplodedNode *N, BugReport &BR) |
Generates the default final diagnostic piece. |
BugReporterVisitors are used to add custom diagnostics along a path.
Custom visitors should subclass the BugReporterVisitorImpl class for a default implementation of the clone() method. (Warning: if you have a deep subclass of BugReporterVisitorImpl, the default implementation of clone() will NOT do the right thing, and you will have to provide your own implementation.)
Definition at line 38 of file BugReporterVisitor.h.
BugReporterVisitor::~BugReporterVisitor | ( | ) | [virtual] |
Definition at line 49 of file BugReporter.cpp.
virtual std::unique_ptr<BugReporterVisitor> clang::ento::BugReporterVisitor::clone | ( | ) | const [pure virtual] |
Returns a copy of this BugReporter.
Custom BugReporterVisitors should not override this method directly. Instead, they should inherit from BugReporterVisitorImpl and provide a protected or public copy constructor.
(Warning: if you have a deep subclass of BugReporterVisitorImpl, the default implementation of clone() will NOT do the right thing, and you will have to provide your own implementation.)
std::unique_ptr< PathDiagnosticPiece > BugReporterVisitor::getDefaultEndPath | ( | BugReporterContext & | BRC, |
const ExplodedNode * | N, | ||
BugReport & | BR | ||
) | [static] |
Generates the default final diagnostic piece.
Definition at line 109 of file BugReporterVisitors.cpp.
References clang::ento::PathDiagnosticLocation::createEndOfPath(), clang::ento::BugReport::getDescription(), clang::ento::BugReport::getRanges(), clang::ento::BugReporterContext::getSourceManager(), and P.
Referenced by clang::ento::GRBugReporter::generatePathDiagnostic().
std::unique_ptr< PathDiagnosticPiece > BugReporterVisitor::getEndPath | ( | BugReporterContext & | BRC, |
const ExplodedNode * | N, | ||
BugReport & | BR | ||
) | [virtual] |
Provide custom definition for the final diagnostic piece on the path - the piece, which is displayed before the path is expanded.
If returns NULL the default implementation will be used. Also note that at most one visitor of a BugReport should generate a non-NULL end of path diagnostic piece.
Reimplemented in clang::ento::LikelyFalsePositiveSuppressionBRVisitor.
Definition at line 104 of file BugReporterVisitors.cpp.
virtual void clang::ento::BugReporterVisitor::Profile | ( | llvm::FoldingSetNodeID & | ID | ) | const [pure virtual] |
Implemented in clang::ento::SuppressInlineDefensiveChecksVisitor, clang::ento::UndefOrNullArgVisitor, clang::ento::LikelyFalsePositiveSuppressionBRVisitor, clang::ento::ConditionBRVisitor, clang::ento::NilReceiverBRVisitor, clang::ento::TrackConstraintBRVisitor, and clang::ento::FindLastStoreBRVisitor.
virtual PathDiagnosticPiece* clang::ento::BugReporterVisitor::VisitNode | ( | const ExplodedNode * | Succ, |
const ExplodedNode * | Pred, | ||
BugReporterContext & | BRC, | ||
BugReport & | BR | ||
) | [pure virtual] |
Return a diagnostic piece which should be associated with the given node.
The last parameter can be used to register a new visitor with the given BugReport while processing a node.
Implemented in clang::ento::SuppressInlineDefensiveChecksVisitor, clang::ento::UndefOrNullArgVisitor, clang::ento::LikelyFalsePositiveSuppressionBRVisitor, clang::ento::ConditionBRVisitor, clang::ento::NilReceiverBRVisitor, clang::ento::TrackConstraintBRVisitor, and clang::ento::FindLastStoreBRVisitor.