clang  7.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/BugReporterVisitors.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 void finalizeVisitor (BugReporterContext &BRC, const ExplodedNode *EndPathNode, BugReport &BR)
 Last function called on the visitor, no further calls to VisitNode would follow. 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 49 of file BugReporterVisitors.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 ( )
virtualdefault

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

◆ finalizeVisitor()

void BugReporterVisitor::finalizeVisitor ( BugReporterContext BRC,
const ExplodedNode EndPathNode,
BugReport BR 
)
virtual

Last function called on the visitor, no further calls to VisitNode would follow.

Reimplemented in clang::ento::LikelyFalsePositiveSuppressionBRVisitor.

Definition at line 187 of file BugReporterVisitors.cpp.

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

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

NOTE that this function can be implemented on at most one used visitor, and otherwise it crahes at runtime.

Definition at line 181 of file BugReporterVisitors.cpp.

Referenced by BugReporterVisitor().

◆ 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: