clang API Documentation
Visitor that tries to report interesting diagnostics from conditions. More...
#include <BugReporterVisitor.h>


Public Member Functions | |
| void | Profile (llvm::FoldingSetNodeID &ID) const |
| virtual PathDiagnosticPiece * | VisitNode (const ExplodedNode *N, const ExplodedNode *Prev, BugReporterContext &BRC, BugReport &BR) |
| Return a diagnostic piece which should be associated with the given node. | |
| PathDiagnosticPiece * | VisitNodeImpl (const ExplodedNode *N, const ExplodedNode *Prev, BugReporterContext &BRC, BugReport &BR) |
| PathDiagnosticPiece * | VisitTerminator (const Stmt *Term, const ExplodedNode *N, const CFGBlock *srcBlk, const CFGBlock *dstBlk, BugReport &R, BugReporterContext &BRC) |
| PathDiagnosticPiece * | VisitTrueTest (const Expr *Cond, bool tookTrue, BugReporterContext &BRC, BugReport &R, const ExplodedNode *N) |
| PathDiagnosticPiece * | VisitTrueTest (const Expr *Cond, const DeclRefExpr *DR, const bool tookTrue, BugReporterContext &BRC, BugReport &R, const ExplodedNode *N) |
| PathDiagnosticPiece * | VisitTrueTest (const Expr *Cond, const BinaryOperator *BExpr, const bool tookTrue, BugReporterContext &BRC, BugReport &R, const ExplodedNode *N) |
| PathDiagnosticPiece * | VisitConditionVariable (StringRef LhsString, const Expr *CondVarExpr, const bool tookTrue, BugReporterContext &BRC, BugReport &R, const ExplodedNode *N) |
| bool | patternMatch (const Expr *Ex, llvm::raw_ostream &Out, BugReporterContext &BRC, BugReport &R, const ExplodedNode *N, llvm::Optional< bool > &prunable) |
Visitor that tries to report interesting diagnostics from conditions.
Definition at line 167 of file BugReporterVisitor.h.
| bool ConditionBRVisitor::patternMatch | ( | const Expr * | Ex, |
| llvm::raw_ostream & | Out, | ||
| BugReporterContext & | BRC, | ||
| BugReport & | R, | ||
| const ExplodedNode * | N, | ||
| llvm::Optional< bool > & | prunable | ||
| ) |
Definition at line 564 of file BugReporterVisitors.cpp.
References clang::ento::SVal::getAsRegion(), clang::ento::ExplodedNode::getLocationContext(), clang::ento::ProgramState::getLValue(), clang::ento::ExplodedNode::getState(), clang::ento::ProgramState::getSVal(), clang::Expr::getType(), clang::Expr::IgnoreParenCasts(), and clang::ento::BugReport::isInteresting().
Referenced by VisitTrueTest().
| void clang::ento::ConditionBRVisitor::Profile | ( | llvm::FoldingSetNodeID & | ID | ) | const [inline, virtual] |
Implements clang::ento::BugReporterVisitor.
Definition at line 169 of file BugReporterVisitor.h.
| PathDiagnosticPiece * ConditionBRVisitor::VisitConditionVariable | ( | StringRef | LhsString, |
| const Expr * | CondVarExpr, | ||
| const bool | tookTrue, | ||
| BugReporterContext & | BRC, | ||
| BugReport & | R, | ||
| const ExplodedNode * | N | ||
| ) |
Definition at line 704 of file BugReporterVisitors.cpp.
References clang::ento::SVal::getAsRegion(), clang::ento::ExplodedNode::getLocationContext(), clang::ento::ProgramState::getLValue(), clang::ento::BugReporterContext::getSourceManager(), clang::ento::ExplodedNode::getState(), clang::Expr::getType(), and clang::ento::BugReport::isInteresting().
Referenced by VisitTrueTest().
| PathDiagnosticPiece * ConditionBRVisitor::VisitNode | ( | const ExplodedNode * | N, |
| const ExplodedNode * | PrevN, | ||
| BugReporterContext & | BRC, | ||
| BugReport & | BR | ||
| ) | [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.
Implements clang::ento::BugReporterVisitor.
Definition at line 121 of file BugReporterVisitors.cpp.
References clang::serialized_diags::create(), clang::ento::ExplodedNode::getFirstPred(), clang::VarDecl::getInit(), clang::ento::ExplodedNode::getLocation(), clang::ento::ExplodedNode::getLocationAs(), clang::ento::BugReporterContext::getSourceManager(), clang::ento::ExplodedNode::getState(), getValue(), clang::ento::MemRegion::isBoundable(), clang::ento::SVal::isUndef(), clang::ento::PathDiagnosticLocation::isValid(), clang::LangAS::Last, NULL, and P.
| PathDiagnosticPiece * ConditionBRVisitor::VisitNodeImpl | ( | const ExplodedNode * | N, |
| const ExplodedNode * | Prev, | ||
| BugReporterContext & | BRC, | ||
| BugReport & | BR | ||
| ) |
Definition at line 457 of file BugReporterVisitors.cpp.
References clang::ento::BugReporterContext::getBugReporter(), clang::ento::ExplodedNode::getLocation(), clang::ento::ExplodedNode::getState(), clang::CFGBlock::getTerminator(), VisitTerminator(), and VisitTrueTest().
| PathDiagnosticPiece * ConditionBRVisitor::VisitTerminator | ( | const Stmt * | Term, |
| const ExplodedNode * | N, | ||
| const CFGBlock * | srcBlk, | ||
| const CFGBlock * | dstBlk, | ||
| BugReport & | R, | ||
| BugReporterContext & | BRC | ||
| ) |
Definition at line 505 of file BugReporterVisitors.cpp.
References clang::ento::BugReporterContext::getASTContext(), clang::Stmt::getStmtClass(), clang::Expr::IgnoreParenNoopCasts(), clang::CFGBlock::succ_begin(), clang::CFGBlock::succ_size(), and VisitTrueTest().
Referenced by VisitNodeImpl().
| PathDiagnosticPiece * ConditionBRVisitor::VisitTrueTest | ( | const Expr * | Cond, |
| bool | tookTrue, | ||
| BugReporterContext & | BRC, | ||
| BugReport & | R, | ||
| const ExplodedNode * | N | ||
| ) |
Definition at line 532 of file BugReporterVisitors.cpp.
References clang::ento::BugReporterContext::getASTContext(), clang::UnaryOperator::getOpcode(), clang::Stmt::getStmtClass(), clang::UnaryOperator::getSubExpr(), clang::Expr::IgnoreParenNoopCasts(), clang::Expr::IgnoreParens(), and clang::UO_LNot.
Referenced by VisitNodeImpl(), and VisitTerminator().
| PathDiagnosticPiece* clang::ento::ConditionBRVisitor::VisitTrueTest | ( | const Expr * | Cond, |
| const DeclRefExpr * | DR, | ||
| const bool | tookTrue, | ||
| BugReporterContext & | BRC, | ||
| BugReport & | R, | ||
| const ExplodedNode * | N | ||
| ) |
| PathDiagnosticPiece * ConditionBRVisitor::VisitTrueTest | ( | const Expr * | Cond, |
| const BinaryOperator * | BExpr, | ||
| const bool | tookTrue, | ||
| BugReporterContext & | BRC, | ||
| BugReport & | R, | ||
| const ExplodedNode * | N | ||
| ) |
Definition at line 619 of file BugReporterVisitors.cpp.
References clang::BO_EQ, clang::BO_GE, clang::BO_GT, clang::BO_LE, clang::BO_LT, clang::BO_NE, clang::BinaryOperator::getLHS(), clang::ento::ExplodedNode::getLocationContext(), clang::BinaryOperator::getOpcode(), clang::BinaryOperator::getOpcodeStr(), clang::BinaryOperator::getRHS(), clang::ento::BugReporterContext::getSourceManager(), clang::BinaryOperator::isAssignmentOp(), patternMatch(), clang::ento::PathDiagnosticEventPiece::setPrunable(), and VisitConditionVariable().