class ExplodedGraph
Declaration
class ExplodedGraph { /* full declaration omitted */ };
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:302
Member Variables
- protected clang::ento::ExplodedGraph::NodeVector Roots
- The roots of the simulation graph. Usually there will be only one, but clients are free to establish multiple subgraphs within a single SimulGraph. Moreover, these subgraphs can often merge when paths from different roots reach the same state at the same program location.
- protected clang::ento::ExplodedGraph::NodeVector EndNodes
- The nodes in the simulation graph which have been specially marked as the endpoint of an abstract simulation path.
- protected llvm::FoldingSet<ExplodedNode> Nodes
- Nodes - The nodes in the graph.
- protected clang::BumpVectorContext BVC
- BVC - Allocator and context for allocating nodes and their predecessor and successor groups.
- protected int64_t NumNodes = 0
- NumNodes - The number of nodes in the graph.
- protected clang::ento::ExplodedGraph::NodeVector ChangedNodes
- A list of recently allocated nodes that can potentially be recycled.
- protected clang::ento::ExplodedGraph::NodeVector FreeNodes
- A list of nodes that can be reused.
- protected unsigned int ReclaimNodeInterval = 0
- If this is 0, nodes will never be reclaimed.
- protected unsigned int ReclaimCounter
- Counter to determine when to reclaim nodes.
Method Overview
- public ExplodedGraph()
- public std::unique_ptr<ExplodedGraph> MakeEmptyGraph() const
- public clang::ento::ExplodedNode * addEndOfPath(clang::ento::ExplodedNode * V)
- public clang::ento::ExplodedNode * addRoot(clang::ento::ExplodedNode * V)
- private void collectNode(clang::ento::ExplodedNode * node)
- public clang::ento::ExplodedNode * createUncachedNode(const clang::ProgramPoint & L, clang::ento::ProgramStateRef State, int64_t Id, bool IsSink = false)
- public bool empty() const
- public void enableNodeReclamation(unsigned int Interval)
- public clang::ento::ExplodedGraph::const_eop_iterator eop_begin() const
- public clang::ento::ExplodedGraph::eop_iterator eop_begin()
- public clang::ento::ExplodedGraph::const_eop_iterator eop_end() const
- public clang::ento::ExplodedGraph::eop_iterator eop_end()
- public llvm::BumpPtrAllocator & getAllocator()
- public clang::ento::ExplodedNode * getNode(const clang::ProgramPoint & L, clang::ento::ProgramStateRef State, bool IsSink = false, bool * IsNew = nullptr)
- public clang::BumpVectorContext & getNodeAllocator()
- public static bool isInterestingLValueExpr(const clang::Expr * Ex)
- public clang::ento::ExplodedGraph::const_node_iterator nodes_begin() const
- public clang::ento::ExplodedGraph::node_iterator nodes_begin()
- public clang::ento::ExplodedGraph::node_iterator nodes_end()
- public clang::ento::ExplodedGraph::const_node_iterator nodes_end() const
- public unsigned int num_eops() const
- public unsigned int num_roots() const
- public void reclaimRecentlyAllocatedNodes()
- public void reserve(unsigned int NodeCount)
- public clang::ento::ExplodedGraph::roots_iterator roots_begin()
- public clang::ento::ExplodedGraph::const_roots_iterator roots_begin() const
- public clang::ento::ExplodedGraph::const_roots_iterator roots_end() const
- public clang::ento::ExplodedGraph::roots_iterator roots_end()
- private bool shouldCollect(const clang::ento::ExplodedNode * node)
- public unsigned int size() const
- public std::unique_ptr<ExplodedGraph> trim(ArrayRef<const clang::ento::ExplodedGraph::NodeTy *> Nodes, clang::ento::InterExplodedGraphMap * ForwardMap = nullptr, clang::ento::InterExplodedGraphMap * InverseMap = nullptr) const
- public ~ExplodedGraph()
Methods
¶ExplodedGraph()
ExplodedGraph()
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:344
¶std::unique_ptr<ExplodedGraph> MakeEmptyGraph()
const
std::unique_ptr<ExplodedGraph> MakeEmptyGraph()
const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:364
¶clang::ento::ExplodedNode* addEndOfPath(
clang::ento::ExplodedNode* V)
clang::ento::ExplodedNode* addEndOfPath(
clang::ento::ExplodedNode* V)
Description
addEndOfPath - Add an untyped node to the set of EOP nodes.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:375
Parameters
¶clang::ento::ExplodedNode* addRoot(
clang::ento::ExplodedNode* V)
clang::ento::ExplodedNode* addRoot(
clang::ento::ExplodedNode* V)
Description
addRoot - Add an untyped node to the set of roots.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:369
Parameters
¶void collectNode(clang::ento::ExplodedNode* node)
void collectNode(clang::ento::ExplodedNode* node)
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:458
Parameters
¶clang::ento::ExplodedNode* createUncachedNode(
const clang::ProgramPoint& L,
clang::ento::ProgramStateRef State,
int64_t Id,
bool IsSink = false)
clang::ento::ExplodedNode* createUncachedNode(
const clang::ProgramPoint& L,
clang::ento::ProgramStateRef State,
int64_t Id,
bool IsSink = false)
Description
Create a node for a (Location, State) pair, but don't store it for deduplication later. This is useful when copying an already completed ExplodedGraph for further processing.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:359
Parameters
- const clang::ProgramPoint& L
- clang::ento::ProgramStateRef State
- int64_t Id
- bool IsSink = false
¶bool empty() const
bool empty() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:383
¶void enableNodeReclamation(unsigned int Interval)
void enableNodeReclamation(unsigned int Interval)
Description
Enable tracking of recently allocated nodes for potential reclamation when calling reclaimRecentlyAllocatedNodes().
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:444
Parameters
- unsigned int Interval
¶clang::ento::ExplodedGraph::const_eop_iterator
eop_begin() const
clang::ento::ExplodedGraph::const_eop_iterator
eop_begin() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:418
¶clang::ento::ExplodedGraph::eop_iterator
eop_begin()
clang::ento::ExplodedGraph::eop_iterator
eop_begin()
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:414
¶clang::ento::ExplodedGraph::const_eop_iterator
eop_end() const
clang::ento::ExplodedGraph::const_eop_iterator
eop_end() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:420
¶clang::ento::ExplodedGraph::eop_iterator eop_end()
clang::ento::ExplodedGraph::eop_iterator eop_end()
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:416
¶llvm::BumpPtrAllocator& getAllocator()
llvm::BumpPtrAllocator& getAllocator()
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:422
¶clang::ento::ExplodedNode* getNode(
const clang::ProgramPoint& L,
clang::ento::ProgramStateRef State,
bool IsSink = false,
bool* IsNew = nullptr)
clang::ento::ExplodedNode* getNode(
const clang::ProgramPoint& L,
clang::ento::ProgramStateRef State,
bool IsSink = false,
bool* IsNew = nullptr)
Description
Retrieve the node associated with a (Location,State) pair, where the 'Location' is a ProgramPoint in the CFG. If no node for this pair exists, it is created. IsNew is set to true if the node was freshly created.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:351
Parameters
- const clang::ProgramPoint& L
- clang::ento::ProgramStateRef State
- bool IsSink = false
- bool* IsNew = nullptr
¶clang::BumpVectorContext& getNodeAllocator()
clang::BumpVectorContext& getNodeAllocator()
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:423
¶static bool isInterestingLValueExpr(
const clang::Expr* Ex)
static bool isInterestingLValueExpr(
const clang::Expr* Ex)
Description
Returns true if nodes for the given expression kind are always kept around.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:454
Parameters
- const clang::Expr* Ex
¶clang::ento::ExplodedGraph::const_node_iterator
nodes_begin() const
clang::ento::ExplodedGraph::const_node_iterator
nodes_begin() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:402
¶clang::ento::ExplodedGraph::node_iterator
nodes_begin()
clang::ento::ExplodedGraph::node_iterator
nodes_begin()
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:398
¶clang::ento::ExplodedGraph::node_iterator
nodes_end()
clang::ento::ExplodedGraph::node_iterator
nodes_end()
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:400
¶clang::ento::ExplodedGraph::const_node_iterator
nodes_end() const
clang::ento::ExplodedGraph::const_node_iterator
nodes_end() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:404
¶unsigned int num_eops() const
unsigned int num_eops() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:381
¶unsigned int num_roots() const
unsigned int num_roots() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:380
¶void reclaimRecentlyAllocatedNodes()
void reclaimRecentlyAllocatedNodes()
Description
Reclaim "uninteresting" nodes created since the last time this method was called.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:450
¶void reserve(unsigned int NodeCount)
void reserve(unsigned int NodeCount)
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:386
Parameters
- unsigned int NodeCount
¶clang::ento::ExplodedGraph::roots_iterator
roots_begin()
clang::ento::ExplodedGraph::roots_iterator
roots_begin()
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:406
¶clang::ento::ExplodedGraph::const_roots_iterator
roots_begin() const
clang::ento::ExplodedGraph::const_roots_iterator
roots_begin() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:410
¶clang::ento::ExplodedGraph::const_roots_iterator
roots_end() const
clang::ento::ExplodedGraph::const_roots_iterator
roots_end() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:412
¶clang::ento::ExplodedGraph::roots_iterator
roots_end()
clang::ento::ExplodedGraph::roots_iterator
roots_end()
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:408
¶bool shouldCollect(
const clang::ento::ExplodedNode* node)
bool shouldCollect(
const clang::ento::ExplodedNode* node)
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:457
Parameters
- const clang::ento::ExplodedNode* node
¶unsigned int size() const
unsigned int size() const
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:384
¶std::unique_ptr<ExplodedGraph> trim(
ArrayRef<
const clang::ento::ExplodedGraph::NodeTy*>
Nodes,
clang::ento::InterExplodedGraphMap*
ForwardMap = nullptr,
clang::ento::InterExplodedGraphMap*
InverseMap = nullptr) const
std::unique_ptr<ExplodedGraph> trim(
ArrayRef<
const clang::ento::ExplodedGraph::NodeTy*>
Nodes,
clang::ento::InterExplodedGraphMap*
ForwardMap = nullptr,
clang::ento::InterExplodedGraphMap*
InverseMap = nullptr) const
Description
Creates a trimmed version of the graph that only contains paths leading to the given nodes.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:438
Parameters
- ArrayRef< const clang::ento::ExplodedGraph::NodeTy*> Nodes
- The nodes which must appear in the final graph. Presumably these are end-of-path nodes (i.e. they have no successors).
- clang::ento::InterExplodedGraphMap* ForwardMap = nullptr
- A optional map from nodes in this graph to nodes in the returned graph.
- clang::ento::InterExplodedGraphMap* InverseMap = nullptr
- An optional map from nodes in the returned graph to nodes in this graph.
Returns
The trimmed graph
¶~ExplodedGraph()
~ExplodedGraph()
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h:345