clang 20.0.0git
|
This is the simplest builder which generates nodes in the ExplodedGraph. More...
#include "clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h"
Public Types | |
using | iterator = ExplodedNodeSet::iterator |
Public Member Functions | |
NodeBuilder (ExplodedNode *SrcNode, ExplodedNodeSet &DstSet, const NodeBuilderContext &Ctx, bool F=true) | |
NodeBuilder (const ExplodedNodeSet &SrcSet, ExplodedNodeSet &DstSet, const NodeBuilderContext &Ctx, bool F=true) | |
virtual | ~NodeBuilder ()=default |
ExplodedNode * | generateNode (const ProgramPoint &PP, ProgramStateRef State, ExplodedNode *Pred) |
Generates a node in the ExplodedGraph. | |
ExplodedNode * | generateSink (const ProgramPoint &PP, ProgramStateRef State, ExplodedNode *Pred) |
Generates a sink in the ExplodedGraph. | |
const ExplodedNodeSet & | getResults () |
iterator | begin () |
Iterators through the results frontier. | |
iterator | end () |
const NodeBuilderContext & | getContext () |
bool | hasGeneratedNodes () |
void | takeNodes (const ExplodedNodeSet &S) |
void | takeNodes (ExplodedNode *N) |
void | addNodes (const ExplodedNodeSet &S) |
void | addNodes (ExplodedNode *N) |
Protected Member Functions | |
virtual bool | checkResults () |
Checks if the results are ready. | |
bool | hasNoSinksInFrontier () |
virtual void | finalizeResults () |
Allow subclasses to finalize results before result_begin() is executed. | |
ExplodedNode * | generateNodeImpl (const ProgramPoint &PP, ProgramStateRef State, ExplodedNode *Pred, bool MarkAsSink=false) |
Protected Attributes | |
const NodeBuilderContext & | C |
bool | Finalized |
Specifies if the builder results have been finalized. | |
bool | HasGeneratedNodes = false |
ExplodedNodeSet & | Frontier |
The frontier set - a set of nodes which need to be propagated after the builder dies. | |
This is the simplest builder which generates nodes in the ExplodedGraph.
The main benefit of the builder is that it automatically tracks the frontier nodes (or destination set). This is the set of nodes which should be propagated to the next step / builder. They are the nodes which have been added to the builder (either as the input node set or as the newly constructed nodes) but did not have any outgoing transitions added.
Definition at line 232 of file CoreEngine.h.
Definition at line 310 of file CoreEngine.h.
|
inline |
Definition at line 269 of file CoreEngine.h.
References clang::ento::ExplodedNodeSet::Add(), and Frontier.
|
inline |
Definition at line 275 of file CoreEngine.h.
References Frontier, hasNoSinksInFrontier(), and clang::ento::ExplodedNodeSet::insert().
|
virtualdefault |
|
inline |
Definition at line 333 of file CoreEngine.h.
References Frontier, and clang::ento::ExplodedNodeSet::insert().
Referenced by clang::ento::ExprEngine::Visit(), clang::ento::ExprEngine::VisitCXXNewExpr(), clang::ento::ExprEngine::VisitDeclStmt(), clang::ento::ExprEngine::VisitIncrementDecrementOperator(), clang::ento::ExprEngine::VisitMemberExpr(), clang::ento::ExprEngine::VisitUnaryOperator(), and clang::ento::StmtNodeBuilder::~StmtNodeBuilder().
|
inline |
Definition at line 334 of file CoreEngine.h.
References clang::ento::ExplodedNodeSet::Add(), and Frontier.
|
inline |
Iterators through the results frontier.
Definition at line 313 of file CoreEngine.h.
References clang::ento::ExplodedNodeSet::begin(), checkResults(), finalizeResults(), and Frontier.
|
inlineprotectedvirtual |
Checks if the results are ready.
Definition at line 249 of file CoreEngine.h.
References Finalized.
Referenced by begin(), and getResults().
|
inline |
Definition at line 319 of file CoreEngine.h.
References clang::ento::ExplodedNodeSet::end(), finalizeResults(), and Frontier.
|
inlineprotectedvirtual |
Allow subclasses to finalize results before result_begin() is executed.
Definition at line 261 of file CoreEngine.h.
Referenced by begin(), end(), and getResults().
|
inline |
Generates a node in the ExplodedGraph.
Definition at line 285 of file CoreEngine.h.
References generateNodeImpl().
Referenced by clang::ento::ExprEngine::evalCall(), clang::ento::StmtNodeBuilder::generateNode(), clang::ento::NodeBuilderWithSinks::generateNode(), clang::ento::ExprEngine::ProcessAutomaticObjDtor(), 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(), and clang::ento::ExprEngine::VisitCXXDestructor().
|
protected |
Definition at line 622 of file CoreEngine.cpp.
References clang::ento::ExplodedNodeSet::Add(), clang::ento::ExplodedNode::addPredecessor(), C, clang::ento::ExplodedNodeSet::erase(), Frontier, clang::ento::NodeBuilderContext::getEngine(), clang::ento::ExplodedGraph::getNode(), and HasGeneratedNodes.
Referenced by generateNode(), clang::ento::BranchNodeBuilder::generateNode(), and generateSink().
|
inline |
Generates a sink in the ExplodedGraph.
When a node is marked as sink, the exploration from the node is stopped - the node becomes the last node on the path and certain kinds of bugs are suppressed.
Definition at line 298 of file CoreEngine.h.
References generateNodeImpl().
Referenced by clang::ento::StmtNodeBuilder::generateSink(), clang::ento::NodeBuilderWithSinks::generateSink(), clang::ento::ExprEngine::ProcessAutomaticObjDtor(), clang::ento::ExprEngine::ProcessMemberDtor(), and clang::ento::ExprEngine::VisitCXXDestructor().
|
inline |
Definition at line 324 of file CoreEngine.h.
References C.
Referenced by clang::ento::CheckerContext::blockCount(), clang::ento::CheckerContext::getBlockID(), and clang::ento::ExprEngine::processCFGBlockEntrance().
|
inline |
Definition at line 304 of file CoreEngine.h.
References checkResults(), finalizeResults(), and Frontier.
Referenced by clang::ento::ExprEngine::VisitCXXNewExpr(), and clang::ento::ExprEngine::VisitDeclStmt().
|
inline |
Definition at line 325 of file CoreEngine.h.
References HasGeneratedNodes.
|
inlineprotected |
|
inline |
Definition at line 327 of file CoreEngine.h.
References clang::ento::ExplodedNodeSet::erase(), and Frontier.
Referenced by clang::ento::BranchNodeBuilder::BranchNodeBuilder(), clang::ento::ExprEngine::ProcessAutomaticObjDtor(), clang::ento::ExprEngine::ProcessDeleteDtor(), clang::ento::ExprEngine::ProcessMemberDtor(), clang::ento::StmtNodeBuilder::StmtNodeBuilder(), clang::ento::ExprEngine::Visit(), clang::ento::ExprEngine::VisitCXXNewExpr(), clang::ento::ExprEngine::VisitDeclStmt(), clang::ento::ExprEngine::VisitIncrementDecrementOperator(), clang::ento::ExprEngine::VisitMemberExpr(), and clang::ento::ExprEngine::VisitUnaryOperator().
|
inline |
Definition at line 332 of file CoreEngine.h.
References clang::ento::ExplodedNodeSet::erase(), and Frontier.
|
protected |
Definition at line 236 of file CoreEngine.h.
Referenced by clang::ento::BranchNodeBuilder::generateNode(), generateNodeImpl(), and getContext().
|
protected |
Specifies if the builder results have been finalized.
For example, if it is set to false, autotransitions are yet to be generated.
Definition at line 240 of file CoreEngine.h.
Referenced by checkResults().
|
protected |
The frontier set - a set of nodes which need to be propagated after the builder dies.
Definition at line 246 of file CoreEngine.h.
Referenced by addNodes(), begin(), end(), generateNodeImpl(), getResults(), hasNoSinksInFrontier(), NodeBuilder(), takeNodes(), and clang::ento::StmtNodeBuilder::~StmtNodeBuilder().
Definition at line 242 of file CoreEngine.h.
Referenced by generateNodeImpl(), and hasGeneratedNodes().