clang  6.0.0svn
Public Member Functions | Static Public Member Functions | List of all members
clang::ento::ConditionBRVisitor Class Referencefinal

Visitor that tries to report interesting diagnostics from conditions. More...

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

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

Public Member Functions

void Profile (llvm::FoldingSetNodeID &ID) const override
 
std::shared_ptr< PathDiagnosticPieceVisitNode (const ExplodedNode *N, const ExplodedNode *Prev, BugReporterContext &BRC, BugReport &BR) override
 Return a diagnostic piece which should be associated with the given node. More...
 
std::shared_ptr< PathDiagnosticPieceVisitNodeImpl (const ExplodedNode *N, const ExplodedNode *Prev, BugReporterContext &BRC, BugReport &BR)
 
std::shared_ptr< PathDiagnosticPieceVisitTerminator (const Stmt *Term, const ExplodedNode *N, const CFGBlock *srcBlk, const CFGBlock *dstBlk, BugReport &R, BugReporterContext &BRC)
 
std::shared_ptr< PathDiagnosticPieceVisitTrueTest (const Expr *Cond, bool tookTrue, BugReporterContext &BRC, BugReport &R, const ExplodedNode *N)
 
std::shared_ptr< PathDiagnosticPieceVisitTrueTest (const Expr *Cond, const DeclRefExpr *DR, const bool tookTrue, BugReporterContext &BRC, BugReport &R, const ExplodedNode *N)
 
std::shared_ptr< PathDiagnosticPieceVisitTrueTest (const Expr *Cond, const BinaryOperator *BExpr, const bool tookTrue, BugReporterContext &BRC, BugReport &R, const ExplodedNode *N)
 
std::shared_ptr< PathDiagnosticPieceVisitConditionVariable (StringRef LhsString, const Expr *CondVarExpr, const bool tookTrue, BugReporterContext &BRC, BugReport &R, const ExplodedNode *N)
 
bool patternMatch (const Expr *Ex, const Expr *ParentEx, raw_ostream &Out, BugReporterContext &BRC, BugReport &R, const ExplodedNode *N, Optional< bool > &prunable)
 
- Public Member Functions inherited from clang::ento::BugReporterVisitor
 BugReporterVisitor ()=default
 
 BugReporterVisitor (const BugReporterVisitor &)=default
 
 BugReporterVisitor (BugReporterVisitor &&)
 
virtual ~BugReporterVisitor ()
 
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...
 

Static Public Member Functions

static const char * getTag ()
 Return the tag associated with this visitor. More...
 
static bool isPieceMessageGeneric (const PathDiagnosticPiece *Piece)
 
- Static Public Member Functions inherited from clang::ento::BugReporterVisitor
static std::unique_ptr< PathDiagnosticPiecegetDefaultEndPath (BugReporterContext &BRC, const ExplodedNode *N, BugReport &BR)
 Generates the default final diagnostic piece. More...
 

Detailed Description

Visitor that tries to report interesting diagnostics from conditions.

Definition at line 185 of file BugReporterVisitors.h.

Member Function Documentation

◆ getTag()

const char * ConditionBRVisitor::getTag ( )
static

Return the tag associated with this visitor.

This tag will be used to make all PathDiagnosticPieces created by this visitor.

Definition at line 1251 of file BugReporterVisitors.cpp.

Referenced by eventsDescribeSameCondition().

◆ isPieceMessageGeneric()

bool ConditionBRVisitor::isPieceMessageGeneric ( const PathDiagnosticPiece Piece)
static

◆ patternMatch()

bool ConditionBRVisitor::patternMatch ( const Expr Ex,
const Expr ParentEx,
raw_ostream &  Out,
BugReporterContext BRC,
BugReport R,
const ExplodedNode N,
Optional< bool > &  prunable 
)

◆ Profile()

void clang::ento::ConditionBRVisitor::Profile ( llvm::FoldingSetNodeID &  ID) const
inlineoverridevirtual

◆ VisitConditionVariable()

std::shared_ptr< PathDiagnosticPiece > ConditionBRVisitor::VisitConditionVariable ( StringRef  LhsString,
const Expr CondVarExpr,
const bool  tookTrue,
BugReporterContext BRC,
BugReport R,
const ExplodedNode N 
)

◆ VisitNode()

std::shared_ptr< PathDiagnosticPiece > ConditionBRVisitor::VisitNode ( const ExplodedNode Succ,
const ExplodedNode Pred,
BugReporterContext BRC,
BugReport BR 
)
overridevirtual

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.

Implements clang::ento::BugReporterVisitor.

Definition at line 1256 of file BugReporterVisitors.cpp.

References clang::ento::SuppressInlineDefensiveChecksVisitor::getTag().

◆ VisitNodeImpl()

std::shared_ptr< PathDiagnosticPiece > ConditionBRVisitor::VisitNodeImpl ( const ExplodedNode N,
const ExplodedNode Prev,
BugReporterContext BRC,
BugReport BR 
)

◆ VisitTerminator()

std::shared_ptr< PathDiagnosticPiece > ConditionBRVisitor::VisitTerminator ( const Stmt Term,
const ExplodedNode N,
const CFGBlock srcBlk,
const CFGBlock dstBlk,
BugReport R,
BugReporterContext BRC 
)

◆ VisitTrueTest() [1/3]

std::shared_ptr< PathDiagnosticPiece > ConditionBRVisitor::VisitTrueTest ( const Expr Cond,
bool  tookTrue,
BugReporterContext BRC,
BugReport R,
const ExplodedNode N 
)

◆ VisitTrueTest() [2/3]

std::shared_ptr< PathDiagnosticPiece > ConditionBRVisitor::VisitTrueTest ( const Expr Cond,
const DeclRefExpr DR,
const bool  tookTrue,
BugReporterContext BRC,
BugReport R,
const ExplodedNode N 
)

◆ VisitTrueTest() [3/3]

std::shared_ptr< PathDiagnosticPiece > ConditionBRVisitor::VisitTrueTest ( const Expr Cond,
const BinaryOperator BExpr,
const bool  tookTrue,
BugReporterContext BRC,
BugReport R,
const ExplodedNode N 
)

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