9 #ifndef CPROVER_GOTO_PROGRAMS_DESTRUCTOR_TREE_H
10 #define CPROVER_GOTO_PROGRAMS_DESTRUCTOR_TREE_H
17 #include <unordered_set>
35 std::size_t left_pre_size,
36 std::size_t right_pre_size)
125 const codet &destructor,
126 std::optional<goto_programt::targett> declaration);
143 std::optional<node_indext> end_index = {},
144 std::optional<node_indext> starting_index = {});
193 declaration->instruction->decl_symbol().get_identifier());
Result of an attempt to find ancestor information about two nodes.
std::size_t left_depth_below_common_ancestor
ancestry_resultt(node_indext node)
std::size_t right_depth_below_common_ancestor
node_indext common_ancestor
ancestry_resultt(node_indext node, std::size_t left_pre_size, std::size_t right_pre_size)
Data structure for representing an arbitrary statement in a program.
Result of a tree query holding both destructor codet and the ID of the node that held it.
destructor_and_idt(const codet &code, node_indext id)
instructionst::iterator targett
This class represents a node in a directed graph.
A generic directed graph with a parametric node type.
std::optional< codet > destructor_value
std::optional< declaration_statet > declaration
std::string dot_attributes(const node_indext &n) const override
Node with attributes suitable for Graphviz DOT format.
Tree to keep track of the destructors generated along each branch of a function.
grapht< scope_nodet > scope_graph
std::optional< declaration_statet > & get_declaration(node_indext index)
Fetches the declaration value for the passed-in node index.
void add(const codet &destructor, std::optional< goto_programt::targett > declaration)
Adds a destructor/declaration pair to the current stack, attaching it to the current node.
void output_dot(std::ostream &os) const
Output scope tree to os in dot format.
void descend_tree()
Walks the current node down to its child.
void set_current_node(std::optional< node_indext > val)
Sets the current node.
const std::vector< destructor_and_idt > get_destructors(std::optional< node_indext > end_index={}, std::optional< node_indext > starting_index={})
Builds a vector of destructors that start from starting_index and ends at end_index.
std::optional< codet > & get_destructor(node_indext index)
Fetches the destructor value for the passed-in node index.
node_indext get_current_node() const
Gets the node that the next addition will be added to as a child.
const ancestry_resultt get_nearest_common_ancestor_info(node_indext left_index, node_indext right_index)
Finds the nearest common ancestor of two nodes and then returns it.
A Template Class for Graphs.
const std::string & id2string(const irep_idt &d)
std::unordered_set< irep_idt, irep_id_hash > accounted_flags
In order to handle user goto statements which jump into a scope the declaration may need to be follow...
goto_programt::targett instruction
This is an iterator which points to the instruction where the declaration takes place.