clang API Documentation

Public Member Functions | Static Public Member Functions
clang::ento::BugReporterVisitor Class Reference

BugReporterVisitors are used to add custom diagnostics along a path. More...

#include <BugReporterVisitor.h>

Inheritance diagram for clang::ento::BugReporterVisitor:
Inheritance graph
[legend]
Collaboration diagram for clang::ento::BugReporterVisitor:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~BugReporterVisitor ()
virtual std::unique_ptr
< BugReporterVisitor
clone () const =0
 Returns a copy of this BugReporter.
virtual PathDiagnosticPieceVisitNode (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.

Detailed Description

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.


Constructor & Destructor Documentation

Definition at line 49 of file BugReporter.cpp.


Member Function Documentation

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]
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]
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.


The documentation for this class was generated from the following files: