clang  7.0.0svn
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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:
Inheritance graph
[legend]
Collaboration diagram for clang::ento::NodeBuilder:
Collaboration graph
[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. More...
 
ExplodedNodegenerateSink (const ProgramPoint &PP, ProgramStateRef State, ExplodedNode *Pred)
 Generates a sink in the ExplodedGraph. More...
 
const ExplodedNodeSetgetResults ()
 
iterator begin ()
 Iterators through the results frontier. More...
 
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. More...
 
bool hasNoSinksInFrontier ()
 
virtual void finalizeResults ()
 Allow subclasses to finalize results before result_begin() is executed. More...
 
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. More...
 
bool HasGeneratedNodes = false
 
ExplodedNodeSetFrontier
 The frontier set - a set of nodes which need to be propagated after the builder dies. More...
 

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

Member Typedef Documentation

◆ iterator

Definition at line 304 of file CoreEngine.h.

Constructor & Destructor Documentation

◆ NodeBuilder() [1/2]

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

Definition at line 265 of file CoreEngine.h.

References clang::ento::ExplodedNodeSet::Add().

◆ NodeBuilder() [2/2]

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

Definition at line 271 of file CoreEngine.h.

References clang::ento::ExplodedNodeSet::insert().

◆ ~NodeBuilder()

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

Member Function Documentation

◆ addNodes() [1/2]

void clang::ento::NodeBuilder::addNodes ( const ExplodedNodeSet S)
inline

Definition at line 327 of file CoreEngine.h.

◆ addNodes() [2/2]

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

Definition at line 328 of file CoreEngine.h.

References clang::ento::ExplodedNodeSet::Add().

◆ begin()

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

Iterators through the results frontier.

Definition at line 307 of file CoreEngine.h.

References clang::ento::ExplodedNodeSet::begin().

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

◆ checkResults()

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

Checks if the results are ready.

Definition at line 245 of file CoreEngine.h.

◆ end()

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

Definition at line 313 of file CoreEngine.h.

References clang::ento::ExplodedNodeSet::end().

◆ finalizeResults()

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

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

Definition at line 257 of file CoreEngine.h.

References State.

◆ generateNode()

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

◆ generateNodeImpl()

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

Definition at line 548 of file CoreEngine.cpp.

References clang::ento::ExplodedNode::addPredecessor().

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

Referenced by clang::ento::NodeBuilderWithSinks::generateSink().

◆ getContext()

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

◆ getResults()

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

Definition at line 298 of file CoreEngine.h.

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

◆ hasGeneratedNodes()

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

Definition at line 319 of file CoreEngine.h.

◆ hasNoSinksInFrontier()

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

Definition at line 249 of file CoreEngine.h.

◆ takeNodes() [1/2]

void clang::ento::NodeBuilder::takeNodes ( const ExplodedNodeSet S)
inline

◆ takeNodes() [2/2]

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

Definition at line 326 of file CoreEngine.h.

References clang::ento::ExplodedNodeSet::erase().

Member Data Documentation

◆ C

const NodeBuilderContext& clang::ento::NodeBuilder::C
protected

Definition at line 232 of file CoreEngine.h.

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

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

◆ HasGeneratedNodes

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

Definition at line 238 of file CoreEngine.h.


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