A multi-procedural control flow graph (CFG) whose nodes store references to instructions in a GOTO program.
More...
#include <cfg.h>
+ Inheritance diagram for cfg_baset< T, P, I >:
+ Collaboration diagram for cfg_baset< T, P, I >:
Get the graph node index for program_point.
Get the CFG graph node relating to program_point.
Get the CFG graph node relating to program_point.
Get a map from program points to their corresponding node indices.
template<typename... arguments>
Run depth-first search on the graph, starting from a single source node.
Run depth-first search on the graph, starting from multiple source nodes.
Removes any edges between nodes in a graph that are unreachable from a given start node.
Removes any edges between nodes in a graph that are unreachable from a vector of start nodes.
Run recursive depth-limited search on the graph, starting from multiple source nodes, to find the nodes reachable within n steps.
Run recursive depth-limited search on the graph, starting from multiple source nodes, to find the nodes reachable within n steps.
Ensure a graph is chordal (contains no 4+-cycles without an edge crossing the cycle) by adding extra edges.
Find connected subgraphs in an undirected graph.
Computes strongly-connected components of a graph and yields a vector expressing a mapping from nodes to components indices.
Find a topological order of the nodes if graph is DAG, return empty list for non-DAG or empty graph.
Static Public Member Functions
Protected Member Functions
- Protected Member Functions inherited from
grapht< N >
Run recursive depth-limited search on the graph, starting from multiple source nodes, to find the nodes reachable within n steps.
Additional Inherited Members
Detailed Description
template<
class T,
typename P = const goto_programt,
typename I = goto_programt::const_targett>
class cfg_baset< T, P, I >
A multi-procedural control flow graph (CFG) whose nodes store references to instructions in a GOTO program.
An instance of cfg_baset<T> is a directed graph whose nodes inherit from a user-provided type T and store a pointer to an instruction of some goto program in the field PC. The field PC of every node points to the original GOTO instruction that gave rise to the node, and the field cfg_baset::entry_map maps every GOTO instruction to some CFG node.
The CFG is constructed on the operator() from either one goto_programt or multiple goto_programt objects (stored in a goto_functionst). The edges of the CFG are created on the method compute_edges(), and notably include:
- Edges from location A to B if both A and B belong to the same goto_programt and A can flow into B.
- An edge from each FUNCTION_CALL instruction and the first instruction of the called function, when that function body is available and its body is non-empty.
For each FUNCTION_CALL instruction found, an edge between the exit point of the called function and the instruction immediately after the FUNCTION_CALL, when the function body is available and its body is non-empty.
Note that cfg_baset is the base class of many other subclasses and the specific edges constructed by operator() can be different in those.
Definition at line 86 of file cfg.h.
Member Typedef Documentation
◆ base_grapht
Definition at line 88 of file cfg.h.
◆ entryt
Definition at line 91 of file cfg.h.
◆ nodet
Definition at line 92 of file cfg.h.
Constructor & Destructor Documentation
◆ cfg_baset()
◆ ~cfg_baset()
Member Function Documentation
◆ compute_edges() [1/3]
◆ compute_edges() [2/3]
◆ compute_edges() [3/3]
◆ compute_edges_catch()
◆ compute_edges_function_call()
◆ compute_edges_goto()
◆ compute_edges_start_thread()
◆ compute_edges_throw()
◆ entries()
Get a map from program points to their corresponding node indices.
Use the indices with operator[] similar to those returned by get_node_index.
Definition at line 259 of file cfg.h.
◆ get_first_node()
◆ get_last_node()
◆ get_node() [1/2]
Get the CFG graph node relating to program_point.
Definition at line 245 of file cfg.h.
◆ get_node() [2/2]
Get the CFG graph node relating to program_point.
Definition at line 251 of file cfg.h.
◆ get_node_index()
Get the graph node index for program_point.
Use this with operator[] to get the related graph node (e.g. cfg[cfg.get_node_index(i)], though in that particular case you should just use cfg.get_node(i)). Storing node indices saves a map lookup, so it can be worthwhile when you expect to repeatedly look up the same program point.
Definition at line 239 of file cfg.h.
◆ nodes_empty()
◆ operator()() [1/2]
◆ operator()() [2/2]
Member Data Documentation
◆ entry_map
The documentation for this class was generated from the following file:
- /home/runner/work/cbmc/cbmc/src/goto-programs/cfg.h