clang 22.0.0git
clang::ento::NodeBuilder Class Reference

This is the simplest builder which generates nodes in the ExplodedGraph. More...

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

Inheritance diagram for clang::ento::NodeBuilder:
[legend]

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
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)

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.
ExplodedNodegenerateNodeImpl (const ProgramPoint &PP, ProgramStateRef State, ExplodedNode *Pred, bool MarkAsSink=false)

Protected Attributes

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 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 240 of file CoreEngine.h.

Member Typedef Documentation

◆ iterator

Constructor & Destructor Documentation

◆ NodeBuilder() [1/2]

◆ NodeBuilder() [2/2]

clang::ento::NodeBuilder::NodeBuilder ( const ExplodedNodeSet & SrcSet,
ExplodedNodeSet & DstSet,
const NodeBuilderContext & Ctx,
bool F = true )
inline

Definition at line 283 of file CoreEngine.h.

References C, Finalized, Frontier, and hasNoSinksInFrontier().

◆ ~NodeBuilder()

virtual clang::ento::NodeBuilder::~NodeBuilder ( )
virtualdefault

Member Function Documentation

◆ addNodes() [1/2]

◆ addNodes() [2/2]

void clang::ento::NodeBuilder::addNodes ( ExplodedNode * N)
inline

Definition at line 342 of file CoreEngine.h.

References Frontier.

◆ begin()

iterator clang::ento::NodeBuilder::begin ( )
inline

Iterators through the results frontier.

Definition at line 321 of file CoreEngine.h.

References checkResults(), finalizeResults(), and Frontier.

◆ checkResults()

virtual bool clang::ento::NodeBuilder::checkResults ( )
inlineprotectedvirtual

Checks if the results are ready.

Definition at line 257 of file CoreEngine.h.

References Finalized.

Referenced by begin(), and getResults().

◆ end()

iterator clang::ento::NodeBuilder::end ( )
inline

Definition at line 327 of file CoreEngine.h.

References finalizeResults(), and Frontier.

◆ finalizeResults()

virtual void clang::ento::NodeBuilder::finalizeResults ( )
inlineprotectedvirtual

Allow subclasses to finalize results before result_begin() is executed.

Definition at line 269 of file CoreEngine.h.

Referenced by begin(), end(), and getResults().

◆ generateNode()

◆ generateNodeImpl()

ExplodedNode * NodeBuilder::generateNodeImpl ( const ProgramPoint & PP,
ProgramStateRef State,
ExplodedNode * Pred,
bool MarkAsSink = false )
protected

◆ generateSink()

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 306 of file CoreEngine.h.

References generateNodeImpl().

Referenced by clang::ento::NodeBuilderWithSinks::generateSink(), clang::ento::StmtNodeBuilder::generateSink(), clang::ento::ExprEngine::ProcessAutomaticObjDtor(), clang::ento::ExprEngine::ProcessMemberDtor(), and clang::ento::ExprEngine::VisitCXXDestructor().

◆ getContext()

const NodeBuilderContext & clang::ento::NodeBuilder::getContext ( )
inline

Definition at line 332 of file CoreEngine.h.

References C.

Referenced by clang::ento::ExprEngine::processCFGBlockEntrance().

◆ getResults()

const ExplodedNodeSet & clang::ento::NodeBuilder::getResults ( )
inline

◆ hasGeneratedNodes()

bool clang::ento::NodeBuilder::hasGeneratedNodes ( )
inline

Definition at line 333 of file CoreEngine.h.

References HasGeneratedNodes.

◆ hasNoSinksInFrontier()

bool clang::ento::NodeBuilder::hasNoSinksInFrontier ( )
inlineprotected

Definition at line 261 of file CoreEngine.h.

References Frontier.

Referenced by NodeBuilder().

◆ takeNodes() [1/2]

◆ takeNodes() [2/2]

void clang::ento::NodeBuilder::takeNodes ( ExplodedNode * N)
inline

Definition at line 340 of file CoreEngine.h.

References Frontier.

Member Data Documentation

◆ C

◆ Finalized

bool clang::ento::NodeBuilder::Finalized
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 248 of file CoreEngine.h.

Referenced by checkResults(), NodeBuilder(), and NodeBuilder().

◆ Frontier

ExplodedNodeSet& clang::ento::NodeBuilder::Frontier
protected

The frontier set - a set of nodes which need to be propagated after the builder dies.

Definition at line 254 of file CoreEngine.h.

Referenced by addNodes(), addNodes(), begin(), end(), generateNodeImpl(), getResults(), hasNoSinksInFrontier(), NodeBuilder(), NodeBuilder(), takeNodes(), takeNodes(), and clang::ento::StmtNodeBuilder::~StmtNodeBuilder().

◆ HasGeneratedNodes

bool clang::ento::NodeBuilder::HasGeneratedNodes = false
protected

Definition at line 250 of file CoreEngine.h.

Referenced by generateNodeImpl(), and hasGeneratedNodes().


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