clang  10.0.0svn
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::ento::ExplodedNode Class Reference

#include "clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h"

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

Public Types

using succ_iterator = ExplodedNode *const *
 
using succ_range = llvm::iterator_range< succ_iterator >
 
using const_succ_iterator = const ExplodedNode *const *
 
using const_succ_range = llvm::iterator_range< const_succ_iterator >
 
using pred_iterator = ExplodedNode *const *
 
using pred_range = llvm::iterator_range< pred_iterator >
 
using const_pred_iterator = const ExplodedNode *const *
 
using const_pred_range = llvm::iterator_range< const_pred_iterator >
 

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 LocationContextgetLocationContext () const
 
const StackFrameContextgetStackFrame () const
 
const DeclgetCodeDecl () const
 
CFGgetCFG () const
 
const CFGBlockgetCFGBlock () const
 
const ParentMapgetParentMap () const
 
template<typename T >
T & getAnalysis () const
 
const ProgramStateRefgetState () 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
 
ExplodedNodegetFirstPred ()
 
const ExplodedNodegetFirstPred () const
 
ExplodedNodegetFirstSucc ()
 
const ExplodedNodegetFirstSucc () const
 
pred_iterator pred_begin ()
 
pred_iterator pred_end ()
 
pred_range preds ()
 
const_pred_iterator pred_begin () const
 
const_pred_iterator pred_end () const
 
const_pred_range preds () const
 
succ_iterator succ_begin ()
 
succ_iterator succ_end ()
 
succ_range succs ()
 
const_succ_iterator succ_begin () const
 
const_succ_iterator succ_end () const
 
const_succ_range succs () 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
 

Detailed Description

Definition at line 65 of file ExplodedGraph.h.

Member Typedef Documentation

◆ const_pred_iterator

Definition at line 234 of file ExplodedGraph.h.

◆ const_pred_range

Definition at line 235 of file ExplodedGraph.h.

◆ const_succ_iterator

Definition at line 228 of file ExplodedGraph.h.

◆ const_succ_range

Definition at line 229 of file ExplodedGraph.h.

◆ pred_iterator

Definition at line 231 of file ExplodedGraph.h.

◆ pred_range

Definition at line 232 of file ExplodedGraph.h.

◆ succ_iterator

Definition at line 225 of file ExplodedGraph.h.

◆ succ_range

Definition at line 226 of file ExplodedGraph.h.

Constructor & Destructor Documentation

◆ ExplodedNode()

clang::ento::ExplodedNode::ExplodedNode ( const ProgramPoint loc,
ProgramStateRef  state,
bool  IsSink 
)
inlineexplicit

Definition at line 135 of file ExplodedGraph.h.

References isSink().

Member Function Documentation

◆ addPredecessor()

void ExplodedNode::addPredecessor ( ExplodedNode V,
ExplodedGraph G 
)

◆ getAnalysis()

template<typename T >
T& clang::ento::ExplodedNode::getAnalysis ( ) const
inline

Definition at line 163 of file ExplodedGraph.h.

References clang::LocationContext::getAnalysis(), and getLocationContext().

◆ getCFG()

CFG& clang::ento::ExplodedNode::getCFG ( ) const
inline

◆ getCFGBlock()

const CFGBlock * ExplodedNode::getCFGBlock ( ) const

Definition at line 296 of file ExplodedGraph.cpp.

References clang::ProgramPoint::getAs(), and P.

Referenced by getCFG().

◆ getCodeDecl()

const Decl& clang::ento::ExplodedNode::getCodeDecl ( ) const
inline

Definition at line 152 of file ExplodedGraph.h.

References clang::LocationContext::getDecl(), and getLocationContext().

◆ getFirstPred() [1/2]

ExplodedNode* clang::ento::ExplodedNode::getFirstPred ( )
inline

◆ getFirstPred() [2/2]

const ExplodedNode* clang::ento::ExplodedNode::getFirstPred ( ) const
inline

Definition at line 212 of file ExplodedGraph.h.

References getFirstPred().

◆ getFirstSucc() [1/2]

ExplodedNode* clang::ento::ExplodedNode::getFirstSucc ( )
inline

◆ getFirstSucc() [2/2]

const ExplodedNode* clang::ento::ExplodedNode::getFirstSucc ( ) const
inline

Definition at line 220 of file ExplodedGraph.h.

References getFirstSucc().

◆ getID()

int64_t ExplodedNode::getID ( ExplodedGraph G) const

Definition at line 286 of file ExplodedGraph.cpp.

References clang::ento::ExplodedGraph::getAllocator().

Referenced by succs().

◆ getLocation()

ProgramPoint clang::ento::ExplodedNode::getLocation ( ) const
inline

◆ getLocationAs()

template<typename T >
Optional<T> clang::ento::ExplodedNode::getLocationAs ( ) const
inline

◆ getLocationContext()

const LocationContext* clang::ento::ExplodedNode::getLocationContext ( ) const
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().

◆ getParentMap()

const ParentMap& clang::ento::ExplodedNode::getParentMap ( ) const
inline

◆ getStackFrame()

const StackFrameContext* clang::ento::ExplodedNode::getStackFrame ( ) const
inline

◆ getState()

const ProgramStateRef& clang::ento::ExplodedNode::getState ( ) const
inline

Definition at line 167 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::BugReporter::FlushReports(), 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().

◆ getSVal()

SVal clang::ento::ExplodedNode::getSVal ( const Stmt S) const
inline

◆ hasSinglePred()

bool clang::ento::ExplodedNode::hasSinglePred ( ) const
inline

Definition at line 204 of file ExplodedGraph.h.

References pred_size().

Referenced by clang::ento::CoreEngine::dispatchWorkItem().

◆ isSink()

bool clang::ento::ExplodedNode::isSink ( ) const
inline

◆ isTrivial()

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 290 of file ExplodedGraph.cpp.

Referenced by llvm::GraphTraits< clang::ento::ExplodedGraph * >::predecessorOfTrivial(), and succs().

◆ pred_begin() [1/2]

pred_iterator clang::ento::ExplodedNode::pred_begin ( )
inline

◆ pred_begin() [2/2]

const_pred_iterator clang::ento::ExplodedNode::pred_begin ( ) const
inline

Definition at line 241 of file ExplodedGraph.h.

References pred_begin().

◆ pred_empty()

bool clang::ento::ExplodedNode::pred_empty ( ) const
inline

◆ pred_end() [1/2]

pred_iterator clang::ento::ExplodedNode::pred_end ( )
inline

Definition at line 238 of file ExplodedGraph.h.

Referenced by clang::ento::BugReporter::FlushReports(), and pred_end().

◆ pred_end() [2/2]

const_pred_iterator clang::ento::ExplodedNode::pred_end ( ) const
inline

Definition at line 244 of file ExplodedGraph.h.

References pred_end().

◆ pred_size()

unsigned clang::ento::ExplodedNode::pred_size ( ) const
inline

◆ preds() [1/2]

pred_range clang::ento::ExplodedNode::preds ( )
inline

Definition at line 239 of file ExplodedGraph.h.

◆ preds() [2/2]

const_pred_range clang::ento::ExplodedNode::preds ( ) const
inline

Definition at line 247 of file ExplodedGraph.h.

◆ Profile() [1/2]

static void clang::ento::ExplodedNode::Profile ( llvm::FoldingSetNodeID &  ID,
const ProgramPoint Loc,
const ProgramStateRef state,
bool  IsSink 
)
inlinestatic

Definition at line 179 of file ExplodedGraph.h.

Referenced by clang::ento::ExplodedGraph::getNode(), and Profile().

◆ Profile() [2/2]

void clang::ento::ExplodedNode::Profile ( llvm::FoldingSetNodeID &  ID) const
inline

Definition at line 188 of file ExplodedGraph.h.

References addPredecessor(), isSink(), Profile(), and V.

◆ succ_begin() [1/2]

succ_iterator clang::ento::ExplodedNode::succ_begin ( )
inline

◆ succ_begin() [2/2]

const_succ_iterator clang::ento::ExplodedNode::succ_begin ( ) const
inline

Definition at line 253 of file ExplodedGraph.h.

References succ_begin().

◆ succ_empty()

bool clang::ento::ExplodedNode::succ_empty ( ) const
inline

Definition at line 199 of file ExplodedGraph.h.

Referenced by getFirstSucc().

◆ succ_end() [1/2]

succ_iterator clang::ento::ExplodedNode::succ_end ( )
inline

◆ succ_end() [2/2]

const_succ_iterator clang::ento::ExplodedNode::succ_end ( ) const
inline

Definition at line 256 of file ExplodedGraph.h.

References succ_end().

◆ succ_size()

unsigned clang::ento::ExplodedNode::succ_size ( ) const
inline

◆ succs() [1/2]

succ_range clang::ento::ExplodedNode::succs ( )
inline

Definition at line 251 of file ExplodedGraph.h.

Referenced by clang::ento::BugReporter::FlushReports().

◆ succs() [2/2]

const_succ_range clang::ento::ExplodedNode::succs ( ) const
inline

Definition at line 259 of file ExplodedGraph.h.

References getID(), isTrivial(), and clang::tooling::node().

Friends And Related Function Documentation

◆ BranchNodeBuilder

friend class BranchNodeBuilder
friend

Definition at line 66 of file ExplodedGraph.h.

◆ CoreEngine

friend class CoreEngine
friend

Definition at line 67 of file ExplodedGraph.h.

◆ EndOfFunctionNodeBuilder

friend class EndOfFunctionNodeBuilder
friend

Definition at line 68 of file ExplodedGraph.h.

◆ ExplodedGraph

friend class ExplodedGraph
friend

Definition at line 69 of file ExplodedGraph.h.

◆ IndirectGotoNodeBuilder

friend class IndirectGotoNodeBuilder
friend

Definition at line 70 of file ExplodedGraph.h.

◆ NodeBuilder

friend class NodeBuilder
friend

Definition at line 71 of file ExplodedGraph.h.

◆ SwitchNodeBuilder

friend class SwitchNodeBuilder
friend

Definition at line 72 of file ExplodedGraph.h.


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