clang
9.0.0
|
#include "clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h"
Public Types | |
using | succ_iterator = ExplodedNode *const * |
using | const_succ_iterator = const ExplodedNode *const * |
using | pred_iterator = ExplodedNode *const * |
using | const_pred_iterator = const ExplodedNode *const * |
Public Member Functions | |
ExplodedNode (const ProgramPoint &loc, ProgramStateRef state, bool IsSink) | |
ProgramPoint | getLocation () const |
getLocation - Returns the edge associated with the given node. More... | |
const LocationContext * | getLocationContext () const |
const StackFrameContext * | getStackFrame () const |
const Decl & | getCodeDecl () const |
CFG & | getCFG () const |
ParentMap & | getParentMap () const |
template<typename T > | |
T & | getAnalysis () const |
const ProgramStateRef & | getState () const |
template<typename T > | |
Optional< T > | getLocationAs () const LLVM_LVALUE_FUNCTION |
SVal | getSVal (const Stmt *S) const |
Get the value of an arbitrary expression at this node. More... | |
void | Profile (llvm::FoldingSetNodeID &ID) const |
void | addPredecessor (ExplodedNode *V, ExplodedGraph &G) |
addPredeccessor - Adds a predecessor to the current node, and in tandem add this node as a successor of the other node. More... | |
unsigned | succ_size () const |
unsigned | pred_size () const |
bool | succ_empty () const |
bool | pred_empty () const |
bool | isSink () const |
bool | hasSinglePred () const |
ExplodedNode * | getFirstPred () |
const ExplodedNode * | getFirstPred () const |
ExplodedNode * | getFirstSucc () |
const ExplodedNode * | getFirstSucc () const |
pred_iterator | pred_begin () |
pred_iterator | pred_end () |
const_pred_iterator | pred_begin () const |
const_pred_iterator | pred_end () const |
succ_iterator | succ_begin () |
succ_iterator | succ_end () |
const_succ_iterator | succ_begin () const |
const_succ_iterator | succ_end () const |
int64_t | getID (ExplodedGraph *G) const |
bool | isTrivial () const |
The node is trivial if it has only one successor, only one predecessor, it's predecessor has only one successor, and its program state is the same as the program state of the previous node. More... | |
Static Public Member Functions | |
static void | Profile (llvm::FoldingSetNodeID &ID, const ProgramPoint &Loc, const ProgramStateRef &state, bool IsSink) |
Friends | |
class | BranchNodeBuilder |
class | CoreEngine |
class | EndOfFunctionNodeBuilder |
class | ExplodedGraph |
class | IndirectGotoNodeBuilder |
class | NodeBuilder |
class | SwitchNodeBuilder |
Definition at line 65 of file ExplodedGraph.h.
using clang::ento::ExplodedNode::const_pred_iterator = const ExplodedNode * const * |
Definition at line 224 of file ExplodedGraph.h.
using clang::ento::ExplodedNode::const_succ_iterator = const ExplodedNode * const * |
Definition at line 222 of file ExplodedGraph.h.
using clang::ento::ExplodedNode::pred_iterator = ExplodedNode * const * |
Definition at line 223 of file ExplodedGraph.h.
using clang::ento::ExplodedNode::succ_iterator = ExplodedNode * const * |
Definition at line 221 of file ExplodedGraph.h.
|
inlineexplicit |
Definition at line 135 of file ExplodedGraph.h.
References isSink().
void ExplodedNode::addPredecessor | ( | ExplodedNode * | V, |
ExplodedGraph & | G | ||
) |
addPredeccessor - Adds a predecessor to the current node, and in tandem add this node as a successor of the other node.
Definition at line 205 of file ExplodedGraph.cpp.
References clang::ento::ExplodedGraph::getAllocator(), clang::ento::ExplodedGraph::getNodeAllocator(), isSink(), clang::tooling::node(), P, clang::BumpVector< T >::push_back(), and V.
Referenced by clang::ento::CoreEngine::enqueueStmtNode(), clang::ento::CoreEngine::ExecuteWorkListWithInitialState(), clang::ento::SwitchNodeBuilder::generateCaseStmtNode(), clang::ento::SwitchNodeBuilder::generateDefaultCaseNode(), clang::ento::IndirectGotoNodeBuilder::generateNode(), clang::ento::NodeBuilder::generateNodeImpl(), clang::ento::ExprEngine::processCallEnter(), clang::ento::ExprEngine::processCallExit(), Profile(), and clang::ento::ExplodedGraph::trim().
|
inline |
Definition at line 159 of file ExplodedGraph.h.
References clang::LocationContext::getAnalysis(), and getLocationContext().
|
inline |
Definition at line 154 of file ExplodedGraph.h.
References clang::LocationContext::getCFG(), and getLocationContext().
|
inline |
Definition at line 152 of file ExplodedGraph.h.
References clang::LocationContext::getDecl(), and getLocationContext().
|
inline |
Definition at line 204 of file ExplodedGraph.h.
References pred_begin(), and pred_empty().
Referenced by clang::ento::CoreEngine::dispatchWorkItem(), clang::ento::allocation_state::getContainerObjRegion(), getFirstPred(), clang::ento::mpi::MPIBugReporter::reportUnmatchedWait(), and clang::ento::taint::TaintBugVisitor::VisitNode().
|
inline |
Definition at line 208 of file ExplodedGraph.h.
References getFirstPred().
|
inline |
Definition at line 212 of file ExplodedGraph.h.
References succ_begin(), and succ_empty().
Referenced by llvm::GraphTraits< clang::ento::ExplodedGraph * >::child_end(), getFirstSucc(), clang::ento::PathDiagnosticLocation::getNextStmt(), and llvm::GraphTraits< clang::ento::ExplodedGraph * >::predecessorOfTrivial().
|
inline |
Definition at line 216 of file ExplodedGraph.h.
References getFirstSucc().
int64_t ExplodedNode::getID | ( | ExplodedGraph * | G | ) | const |
Definition at line 285 of file ExplodedGraph.cpp.
References clang::ento::ExplodedGraph::getAllocator().
Referenced by succ_end().
|
inline |
getLocation - Returns the edge associated with the given node.
Definition at line 142 of file ExplodedGraph.h.
Referenced by clang::ento::PathDiagnosticLocation::createEndOfPath(), clang::ento::CoreEngine::dispatchWorkItem(), clang::ento::WorkList::enqueue(), clang::ento::CoreEngine::enqueueStmtNode(), clang::ento::ExprEngine::evalEagerlyAssumeBinOpBifurcation(), clang::ento::CoreEngine::ExecuteWorkList(), getLocationContext(), clang::ento::CheckerContext::getLocationRegionIfPostStore(), clang::ento::StackHintGeneratorForSymbol::getMessage(), getStackFrame(), clang::ento::PathDiagnosticLocation::getStmt(), clang::ento::ExplodedGraph::isInterestingLValueExpr(), clang::ento::WorkList::makeBFSBlockDFSContents(), clang::ento::WorkList::makeUnexploredFirst(), clang::ento::WorkList::makeUnexploredFirstPriorityQueue(), clang::ento::ExprEngine::processCFGBlockEntrance(), clang::ento::ExprEngine::processEndOfFunction(), clang::ento::mpi::MPIBugReporter::reportUnmatchedWait(), clang::ento::ExplodedGraph::trim(), clang::ento::ExprEngine::VisitLogicalExpr(), and clang::ento::ExprEngine::VisitObjCMessage().
|
inline |
Definition at line 166 of file ExplodedGraph.h.
References clang::ProgramPoint::getAs().
Referenced by clang::ento::PathDiagnosticLocation::createEndOfPath().
|
inline |
Definition at line 144 of file ExplodedGraph.h.
References getLocation(), and clang::ProgramPoint::getLocationContext().
Referenced by clang::ento::ExprEngine::bindReturnValue(), clang::ento::retaincountchecker::RetainCountChecker::checkEndFunction(), clang::ento::ExprEngine::CreateCXXTemporaryObject(), clang::ento::PathDiagnosticLocation::createEndOfPath(), clang::ento::CoreEngine::enqueueStmtNode(), clang::ento::ExprEngine::evalBind(), clang::ento::ExprEngine::evalEagerlyAssumeBinOpBifurcation(), clang::ento::CoreEngine::ExecuteWorkListWithInitialState(), clang::ento::SwitchNodeBuilder::generateCaseStmtNode(), clang::ento::SwitchNodeBuilder::generateDefaultCaseNode(), clang::ento::BranchNodeBuilder::generateNode(), clang::ento::IndirectGotoNodeBuilder::generateNode(), getAnalysis(), getCFG(), getCodeDecl(), clang::ento::CheckerContext::getCurrentAnalysisDeclContext(), clang::ento::BugReport::getDeclWithIssue(), clang::ento::CheckerContext::getLocationContext(), clang::ento::IndirectGotoNodeBuilder::getLocationContext(), clang::ento::SwitchNodeBuilder::getLocationContext(), getParentMap(), clang::ento::PathDiagnosticLocation::getStmt(), isCXXSharedPtrDtor(), clang::ento::ExplodedGraph::isInterestingLValueExpr(), clang::ento::WorkList::makeBFSBlockDFSContents(), clang::ento::WorkList::makeUnexploredFirst(), clang::ento::ExprEngine::ProcessAutomaticObjDtor(), clang::ento::ExprEngine::ProcessBaseDtor(), clang::ento::ExprEngine::processBranch(), clang::ento::ExprEngine::processCallExit(), clang::ento::ExprEngine::processCFGBlockEntrance(), clang::ento::ExprEngine::processCFGElement(), clang::ento::ExprEngine::processCleanupTemporaryBranch(), clang::ento::ExprEngine::ProcessDeleteDtor(), clang::ento::ExprEngine::processEndOfFunction(), clang::ento::ExprEngine::ProcessInitializer(), clang::ento::ExprEngine::ProcessLoopExit(), clang::ento::ExprEngine::ProcessMemberDtor(), clang::ento::ExprEngine::ProcessNewAllocator(), clang::ento::retaincountchecker::RetainCountChecker::processObjCLiterals(), clang::ento::ExprEngine::ProcessStmt(), clang::ento::ExprEngine::ProcessTemporaryDtor(), clang::ento::ExprEngine::removeDeadOnEndOfFunction(), clang::ento::CheckerManager::runCheckersForBranchCondition(), clang::ento::CheckerManager::runCheckersForCallEvent(), clang::ento::CheckerManager::runCheckersForEndFunction(), clang::ento::updateLoopStack(), clang::ento::ExprEngine::Visit(), clang::ento::ExprEngine::VisitBlockExpr(), clang::ento::ExprEngine::VisitCallExpr(), clang::ento::ExprEngine::VisitCast(), clang::ento::ExprEngine::VisitCommonDeclRefExpr(), clang::ento::ExprEngine::VisitCompoundLiteralExpr(), clang::ento::ExprEngine::VisitCXXCatchStmt(), clang::ento::ExprEngine::VisitCXXConstructExpr(), clang::ento::ExprEngine::VisitCXXNewAllocatorCall(), clang::ento::ExprEngine::VisitCXXNewExpr(), clang::ento::ExprEngine::VisitCXXThisExpr(), clang::ento::ExprEngine::VisitDeclStmt(), clang::ento::ExprEngine::VisitGCCAsmStmt(), clang::ento::ExprEngine::VisitGuardedExpr(), clang::ento::ExprEngine::VisitIncrementDecrementOperator(), clang::ento::ExprEngine::VisitInitListExpr(), clang::ento::ExprEngine::VisitLambdaExpr(), clang::ento::ExprEngine::VisitLogicalExpr(), clang::ento::ExprEngine::VisitLvalObjCIvarRefExpr(), clang::ento::taint::TaintBugVisitor::VisitNode(), and clang::ento::ExprEngine::VisitObjCMessage().
|
inline |
Definition at line 156 of file ExplodedGraph.h.
References getLocationContext(), and clang::LocationContext::getParentMap().
|
inline |
Definition at line 148 of file ExplodedGraph.h.
References getLocation(), and clang::ProgramPoint::getStackFrame().
Referenced by clang::ento::CheckerContext::getStackFrame(), clang::ento::ExprEngine::processCallExit(), and clang::ento::ExprEngine::processEndOfFunction().
|
inline |
Definition at line 163 of file ExplodedGraph.h.
Referenced by clang::ento::mpi::MPIChecker::checkDoubleNonblocking(), clang::ento::retaincountchecker::RetainCountChecker::checkEndFunction(), clang::ento::CheckerContext::CheckerContext(), clang::ento::retaincountchecker::RetainCountChecker::checkPostStmt(), clang::ento::ExprEngine::CreateCXXTemporaryObject(), clang::ento::ExprEngine::defaultEvalCall(), clang::ento::CoreEngine::enqueueStmtNode(), clang::ento::ExprEngine::evalBind(), clang::ento::ExprEngine::evalEagerlyAssumeBinOpBifurcation(), clang::ento::ExprEngine::evalLoad(), clang::ento::CoreEngine::ExecuteWorkListWithInitialState(), clang::ento::allocation_state::getContainerObjRegion(), clang::ento::StackHintGeneratorForSymbol::getMessage(), clang::ento::CheckerContext::getState(), clang::ento::ExplodedGraph::isInterestingLValueExpr(), clang::ento::ExprEngine::ProcessAutomaticObjDtor(), clang::ento::ExprEngine::ProcessBaseDtor(), clang::ento::ExprEngine::processBranch(), clang::ento::ExprEngine::processCallEnter(), clang::ento::ExprEngine::processCallExit(), clang::ento::ExprEngine::processCFGBlockEntrance(), clang::ento::ExprEngine::processCleanupTemporaryBranch(), clang::ento::ExprEngine::ProcessDeleteDtor(), clang::ento::ExprEngine::processEndOfFunction(), clang::ento::ExprEngine::ProcessInitializer(), clang::ento::ExprEngine::ProcessLoopExit(), clang::ento::ExprEngine::ProcessMemberDtor(), clang::ento::ExprEngine::ProcessNewAllocator(), clang::ento::ExprEngine::ProcessTemporaryDtor(), clang::ento::ExprEngine::removeDead(), clang::ento::mpi::MPIBugReporter::reportUnmatchedWait(), clang::ento::CheckerManager::runCheckersForObjCMessage(), clang::ento::updateLoopStack(), clang::ento::ExprEngine::Visit(), clang::ento::ExprEngine::VisitBlockExpr(), clang::ento::ExprEngine::VisitCallExpr(), clang::ento::ExprEngine::VisitCast(), clang::ento::ExprEngine::VisitCommonDeclRefExpr(), clang::ento::ExprEngine::VisitCompoundLiteralExpr(), clang::ento::ExprEngine::VisitCXXCatchStmt(), clang::ento::ExprEngine::VisitCXXConstructExpr(), clang::ento::ExprEngine::VisitCXXDeleteExpr(), clang::ento::ExprEngine::VisitCXXNewAllocatorCall(), clang::ento::ExprEngine::VisitCXXNewExpr(), clang::ento::ExprEngine::VisitCXXThisExpr(), clang::ento::ExprEngine::VisitDeclStmt(), clang::ento::ExprEngine::VisitGCCAsmStmt(), clang::ento::ExprEngine::VisitGuardedExpr(), clang::ento::ExprEngine::VisitIncrementDecrementOperator(), clang::ento::ExprEngine::VisitInitListExpr(), clang::ento::ExprEngine::VisitLambdaExpr(), clang::ento::ExprEngine::VisitLogicalExpr(), clang::ento::ExprEngine::VisitLvalObjCIvarRefExpr(), clang::ento::ExprEngine::VisitMSAsmStmt(), clang::ento::taint::TaintBugVisitor::VisitNode(), and clang::ento::ExprEngine::VisitObjCMessage().
Get the value of an arbitrary expression at this node.
Definition at line 171 of file ExplodedGraph.h.
Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkPostStmt(), clang::ento::CheckerContext::getCalleeDecl(), clang::ento::StackHintGeneratorForSymbol::getMessage(), and clang::ento::retaincountchecker::RetainCountChecker::processObjCLiterals().
|
inline |
Definition at line 200 of file ExplodedGraph.h.
References pred_size().
Referenced by clang::ento::CoreEngine::dispatchWorkItem().
|
inline |
Definition at line 198 of file ExplodedGraph.h.
Referenced by clang::ento::ExplodedNodeSet::Add(), addPredecessor(), clang::ento::CoreEngine::enqueueStmtNode(), ExplodedNode(), clang::ento::ExplodedNodeSet::ExplodedNodeSet(), clang::ento::NodeBuilderWithSinks::generateSink(), Profile(), and clang::ento::ExplodedGraph::trim().
bool ExplodedNode::isTrivial | ( | ) | const |
The node is trivial if it has only one successor, only one predecessor, it's predecessor has only one successor, and its program state is the same as the program state of the previous node.
Trivial nodes may be skipped while printing exploded graph.
Definition at line 289 of file ExplodedGraph.cpp.
Referenced by llvm::GraphTraits< clang::ento::ExplodedGraph * >::predecessorOfTrivial(), and succ_end().
|
inline |
Definition at line 226 of file ExplodedGraph.h.
Referenced by alreadyExecutedAtLeastOneLoopIteration(), getFirstPred(), clang::ento::ExplodedGraph::isInterestingLValueExpr(), pred_begin(), clang::ento::ExprEngine::VisitGuardedExpr(), and clang::ento::ExprEngine::VisitLogicalExpr().
|
inline |
Definition at line 229 of file ExplodedGraph.h.
References pred_begin().
|
inline |
Definition at line 196 of file ExplodedGraph.h.
Referenced by getFirstPred(), and clang::ento::isPossiblyEscaped().
|
inline |
Definition at line 227 of file ExplodedGraph.h.
Referenced by pred_end().
|
inline |
Definition at line 232 of file ExplodedGraph.h.
References pred_end().
|
inline |
Definition at line 194 of file ExplodedGraph.h.
Referenced by hasSinglePred(), clang::ento::ExplodedGraph::isInterestingLValueExpr(), and clang::ento::ExprEngine::VisitLogicalExpr().
|
inlinestatic |
Definition at line 175 of file ExplodedGraph.h.
Referenced by clang::ento::ExplodedGraph::getNode(), and Profile().
|
inline |
Definition at line 184 of file ExplodedGraph.h.
References addPredecessor(), isSink(), Profile(), and V.
|
inline |
Definition at line 236 of file ExplodedGraph.h.
Referenced by llvm::GraphTraits< clang::ento::ExplodedGraph * >::child_begin(), getFirstSucc(), clang::ento::ExplodedGraph::isInterestingLValueExpr(), and succ_begin().
|
inline |
Definition at line 239 of file ExplodedGraph.h.
References succ_begin().
|
inline |
Definition at line 195 of file ExplodedGraph.h.
Referenced by getFirstSucc().
|
inline |
Definition at line 237 of file ExplodedGraph.h.
Referenced by llvm::GraphTraits< clang::ento::ExplodedGraph * >::child_end(), and succ_end().
|
inline |
Definition at line 242 of file ExplodedGraph.h.
References getID(), isTrivial(), clang::tooling::node(), and succ_end().
|
inline |
Definition at line 193 of file ExplodedGraph.h.
Referenced by clang::ento::ExplodedGraph::isInterestingLValueExpr(), and llvm::GraphTraits< clang::ento::ExplodedGraph * >::predecessorOfTrivial().
|
friend |
Definition at line 66 of file ExplodedGraph.h.
|
friend |
Definition at line 67 of file ExplodedGraph.h.
|
friend |
Definition at line 68 of file ExplodedGraph.h.
|
friend |
Definition at line 69 of file ExplodedGraph.h.
|
friend |
Definition at line 70 of file ExplodedGraph.h.
|
friend |
Definition at line 71 of file ExplodedGraph.h.
|
friend |
Definition at line 72 of file ExplodedGraph.h.