clang 20.0.0git
Public Member Functions | List of all members
clang::ento::StmtNodeBuilder Class Reference

This builder class is useful for generating nodes that resulted from visiting a statement. More...

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

Inheritance diagram for clang::ento::StmtNodeBuilder:
Inheritance graph
[legend]

Public Member Functions

 StmtNodeBuilder (ExplodedNode *SrcNode, ExplodedNodeSet &DstSet, const NodeBuilderContext &Ctx, NodeBuilder *Enclosing=nullptr)
 Constructs a StmtNodeBuilder.
 
 StmtNodeBuilder (ExplodedNodeSet &SrcSet, ExplodedNodeSet &DstSet, const NodeBuilderContext &Ctx, NodeBuilder *Enclosing=nullptr)
 
 ~StmtNodeBuilder () override
 
ExplodedNodegenerateNode (const Stmt *S, ExplodedNode *Pred, ProgramStateRef St, const ProgramPointTag *tag=nullptr, ProgramPoint::Kind K=ProgramPoint::PostStmtKind)
 
ExplodedNodegenerateSink (const Stmt *S, ExplodedNode *Pred, ProgramStateRef St, const ProgramPointTag *tag=nullptr, ProgramPoint::Kind K=ProgramPoint::PostStmtKind)
 
ExplodedNodegenerateNode (const ProgramPoint &PP, ProgramStateRef State, ExplodedNode *Pred)
 Generates a node in the ExplodedGraph.
 
ExplodedNodegenerateSink (const ProgramPoint &PP, ProgramStateRef State, ExplodedNode *Pred)
 Generates a sink in the ExplodedGraph.
 
- Public Member Functions inherited from clang::ento::NodeBuilder
 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
 
ExplodedNodegenerateNode (const ProgramPoint &PP, ProgramStateRef State, ExplodedNode *Pred)
 Generates a node in the ExplodedGraph.
 
ExplodedNodegenerateSink (const ProgramPoint &PP, ProgramStateRef State, ExplodedNode *Pred)
 Generates a sink in the ExplodedGraph.
 
const ExplodedNodeSetgetResults ()
 
iterator begin ()
 Iterators through the results frontier.
 
iterator end ()
 
const NodeBuilderContextgetContext ()
 
bool hasGeneratedNodes ()
 
void takeNodes (const ExplodedNodeSet &S)
 
void takeNodes (ExplodedNode *N)
 
void addNodes (const ExplodedNodeSet &S)
 
void addNodes (ExplodedNode *N)
 

Additional Inherited Members

- Public Types inherited from clang::ento::NodeBuilder
using iterator = ExplodedNodeSet::iterator
 
- Protected Member Functions inherited from clang::ento::NodeBuilder
virtual bool checkResults ()
 Checks if the results are ready.
 
bool hasNoSinksInFrontier ()
 
virtual void finalizeResults ()
 Allow subclasses to finalize results before result_begin() is executed.
 
ExplodedNodegenerateNodeImpl (const ProgramPoint &PP, ProgramStateRef State, ExplodedNode *Pred, bool MarkAsSink=false)
 
- Protected Attributes inherited from clang::ento::NodeBuilder
const NodeBuilderContextC
 
bool Finalized
 Specifies if the builder results have been finalized.
 
bool HasGeneratedNodes = false
 
ExplodedNodeSetFrontier
 The frontier set - a set of nodes which need to be propagated after the builder dies.
 

Detailed Description

This builder class is useful for generating nodes that resulted from visiting a statement.

The main difference from its parent NodeBuilder is that it creates a statement specific ProgramPoint.

Definition at line 376 of file CoreEngine.h.

Constructor & Destructor Documentation

◆ StmtNodeBuilder() [1/2]

clang::ento::StmtNodeBuilder::StmtNodeBuilder ( ExplodedNode SrcNode,
ExplodedNodeSet DstSet,
const NodeBuilderContext Ctx,
NodeBuilder Enclosing = nullptr 
)
inline

Constructs a StmtNodeBuilder.

If the builder is going to process nodes currently owned by another builder(with larger scope), use Enclosing builder to transfer ownership.

Definition at line 383 of file CoreEngine.h.

References clang::ento::NodeBuilder::takeNodes().

◆ StmtNodeBuilder() [2/2]

clang::ento::StmtNodeBuilder::StmtNodeBuilder ( ExplodedNodeSet SrcSet,
ExplodedNodeSet DstSet,
const NodeBuilderContext Ctx,
NodeBuilder Enclosing = nullptr 
)
inline

Definition at line 391 of file CoreEngine.h.

References clang::ento::NodeBuilder::takeNodes().

◆ ~StmtNodeBuilder()

StmtNodeBuilder::~StmtNodeBuilder ( )
override

Member Function Documentation

◆ generateNode() [1/2]

ExplodedNode * clang::ento::NodeBuilder::generateNode ( const ProgramPoint PP,
ProgramStateRef  State,
ExplodedNode Pred 
)
inline

Generates a node in the ExplodedGraph.

Definition at line 285 of file CoreEngine.h.

◆ generateNode() [2/2]

ExplodedNode * clang::ento::StmtNodeBuilder::generateNode ( const Stmt S,
ExplodedNode Pred,
ProgramStateRef  St,
const ProgramPointTag tag = nullptr,
ProgramPoint::Kind  K = ProgramPoint::PostStmtKind 
)
inline

Definition at line 405 of file CoreEngine.h.

References clang::ento::NodeBuilder::generateNode(), clang::ento::ExplodedNode::getLocationContext(), and clang::ProgramPoint::getProgramPoint().

Referenced by clang::ento::ExprEngine::CreateCXXTemporaryObject(), clang::ento::ExprEngine::evalEagerlyAssumeBifurcation(), clang::ento::ExprEngine::evalLoad(), clang::ento::ExprEngine::handleLValueBitCast(), clang::ento::ExprEngine::handleUOExtension(), populateObjCForDestinationSet(), clang::ento::ExprEngine::ProcessTemporaryDtor(), clang::ento::ExprEngine::removeDead(), clang::ento::ExprEngine::Visit(), clang::ento::ExprEngine::VisitArrayInitLoopExpr(), clang::ento::ExprEngine::VisitArraySubscriptExpr(), clang::ento::ExprEngine::VisitAtomicExpr(), clang::ento::ExprEngine::VisitBinaryOperator(), clang::ento::ExprEngine::VisitBlockExpr(), clang::ento::ExprEngine::VisitCast(), clang::ento::ExprEngine::VisitCommonDeclRefExpr(), clang::ento::ExprEngine::VisitCompoundLiteralExpr(), clang::ento::ExprEngine::VisitCXXBindTemporaryExpr(), clang::ento::ExprEngine::VisitCXXCatchStmt(), 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::VisitInitListExpr(), clang::ento::ExprEngine::VisitLambdaExpr(), clang::ento::ExprEngine::VisitLogicalExpr(), clang::ento::ExprEngine::VisitLvalObjCIvarRefExpr(), clang::ento::ExprEngine::VisitMemberExpr(), clang::ento::ExprEngine::VisitMSAsmStmt(), clang::ento::ExprEngine::VisitObjCMessage(), clang::ento::ExprEngine::VisitOffsetOfExpr(), clang::ento::ExprEngine::VisitReturnStmt(), clang::ento::ExprEngine::VisitUnaryExprOrTypeTraitExpr(), and clang::ento::ExprEngine::VisitUnaryOperator().

◆ generateSink() [1/2]

ExplodedNode * clang::ento::NodeBuilder::generateSink ( const ProgramPoint PP,
ProgramStateRef  State,
ExplodedNode Pred 
)
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.

◆ generateSink() [2/2]

ExplodedNode * clang::ento::StmtNodeBuilder::generateSink ( const Stmt S,
ExplodedNode Pred,
ProgramStateRef  St,
const ProgramPointTag tag = nullptr,
ProgramPoint::Kind  K = ProgramPoint::PostStmtKind 
)
inline

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