2323#include < util/numbering.h>
2424
2525
26- // / Function call graph inherits from grapht to allow forward and
26+ // / \brief Function call graph: each node represents a function
27+ // / in the GOTO model, a directed edge from A to B indicates
28+ // / that function A calls function B.
29+ // / Inherits from grapht to allow forward and
2730// / backward traversal of the function call graph
28-
2931struct call_graph_nodet : public graph_nodet <empty_edget>
3032{
3133 typedef graph_nodet<empty_edget>::edget edget;
@@ -43,11 +45,28 @@ class call_grapht: public grapht<call_graph_nodet>
4345
4446 void add (const irep_idt &caller, const irep_idt &callee);
4547 void output_xml (std::ostream &out) const ;
48+
49+ // / \return the inverted call graph
4650 call_grapht get_inverted () const ;
51+
52+ // / \brief get the names of all functions reachable from a start function
53+ // / \param start name of initial function
54+ // / \return set of all names of the reachable functions
4755 std::unordered_set<irep_idt, irep_id_hash>
4856 reachable_functions (irep_idt start);
57+
58+ // / \brief Function returns the shortest path on the function call graph
59+ // / between a source and a destination function
60+ // / \param src name of the starting function
61+ // / \param dest name of the destination function
62+ // / \return list of function names on the shortest path between src and dest
4963 std::list<irep_idt>shortest_function_path (irep_idt src, irep_idt dest);
5064
65+ // / get the index of the node that corresponds to a function name
66+ // / \param[in] function_name function_name passed by reference
67+ // / \param[out] n variable for the node index to be written to
68+ // / \return true if a node with the given function name exists,
69+ // / false if it does not exist
5170 bool get_node_index (const irep_idt& function_name, node_indext &n) const
5271 {
5372 for (node_indext idx = 0 ; idx < nodes.size (); idx++)
@@ -61,6 +80,9 @@ class call_grapht: public grapht<call_graph_nodet>
6180 return false ;
6281 }
6382
83+ // / \brief get a list of functions called by a function
84+ // / \param function_name the irep_idt of the function
85+ // / \return an unordered set of all functions called by function_name
6486 std::unordered_set<irep_idt, irep_id_hash> get_successors (
6587 const irep_idt& function_name) const
6688 {
0 commit comments