clang  6.0.0svn
Public Member Functions | Static Public Member Functions | List of all members
clang::ento::BugReporterVisitor Class Referenceabstract

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

#include "clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h"

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

Public Member Functions

 BugReporterVisitor ()=default
 
 BugReporterVisitor (const BugReporterVisitor &)=default
 
 BugReporterVisitor (BugReporterVisitor &&)
 
virtual ~BugReporterVisitor ()
 
virtual std::unique_ptr< BugReporterVisitorclone () const =0
 Returns a copy of this BugReporter. More...
 
virtual std::shared_ptr< PathDiagnosticPieceVisitNode (const ExplodedNode *Succ, const ExplodedNode *Pred, BugReporterContext &BRC, BugReport &BR)=0
 Return a diagnostic piece which should be associated with the given node. More...
 
virtual std::unique_ptr< PathDiagnosticPiecegetEndPath (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. More...
 
virtual void Profile (llvm::FoldingSetNodeID &ID) const =0
 

Static Public Member Functions

static std::unique_ptr< PathDiagnosticPiecegetDefaultEndPath (BugReporterContext &BRC, const ExplodedNode *N, BugReport &BR)
 Generates the default final diagnostic piece. More...
 

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 39 of file BugReporterVisitor.h.

Constructor & Destructor Documentation

◆ BugReporterVisitor() [1/3]

clang::ento::BugReporterVisitor::BugReporterVisitor ( )
default

◆ BugReporterVisitor() [2/3]

clang::ento::BugReporterVisitor::BugReporterVisitor ( const BugReporterVisitor )
default

◆ BugReporterVisitor() [3/3]

clang::ento::BugReporterVisitor::BugReporterVisitor ( BugReporterVisitor &&  )
inline

◆ ~BugReporterVisitor()

BugReporterVisitor::~BugReporterVisitor ( )
virtual

Definition at line 50 of file BugReporter.cpp.

Referenced by BugReporterVisitor().

Member Function Documentation

◆ clone()

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

Referenced by BugReporterVisitor().

◆ getDefaultEndPath()

std::unique_ptr< PathDiagnosticPiece > BugReporterVisitor::getDefaultEndPath ( BugReporterContext BRC,
const ExplodedNode N,
BugReport BR 
)
static

◆ getEndPath()

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 108 of file BugReporterVisitors.cpp.

Referenced by BugReporterVisitor(), and clang::ento::LikelyFalsePositiveSuppressionBRVisitor::VisitNode().

◆ Profile()

virtual void clang::ento::BugReporterVisitor::Profile ( llvm::FoldingSetNodeID &  ID) const
pure virtual

◆ VisitNode()

virtual std::shared_ptr<PathDiagnosticPiece> clang::ento::BugReporterVisitor::VisitNode ( const ExplodedNode Succ,
const ExplodedNode Pred,
BugReporterContext BRC,
BugReport BR 
)
pure virtual

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