cprover
call_graph_helpers.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Function Call Graph Helpers
4 
5 Author: Chris Smowton, chris.smowton@diffblue.com
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_ANALYSES_CALL_GRAPH_HELPERS_H
13 #define CPROVER_ANALYSES_CALL_GRAPH_HELPERS_H
14 
15 #include "call_graph.h"
16 
17 // These are convenience functions for working with the directed graph
18 // representation of a call graph, obtained via
19 // `call_grapht::get_directed_graph`. Usually function names must be mapped
20 // to and from node indices, as in `graph.get_node_index("f")`, or
21 // `graph[node_index].function`; these helpers include the translation for
22 // convenience.
23 
28 std::set<irep_idt> get_callees(
29  const call_grapht::directed_grapht &graph, const irep_idt &function);
30 
35 std::set<irep_idt> get_callers(
36  const call_grapht::directed_grapht &graph, const irep_idt &function);
37 
42 std::set<irep_idt> get_reachable_functions(
43  const call_grapht::directed_grapht &graph, const irep_idt &function);
44 
49 std::set<irep_idt> get_reaching_functions(
50  const call_grapht::directed_grapht &graph, const irep_idt &function);
51 
52 #endif
std::set< irep_idt > get_callees(const call_grapht::directed_grapht &graph, const irep_idt &function)
Get functions directly callable from a given function.
Function Call Graphs.
std::set< irep_idt > get_reachable_functions(const call_grapht::directed_grapht &graph, const irep_idt &function)
Get functions reachable from a given function.
Directed graph representation of this call graph.
Definition: call_graph.h:117
std::set< irep_idt > get_callers(const call_grapht::directed_grapht &graph, const irep_idt &function)
Get functions that call a given function.
std::set< irep_idt > get_reaching_functions(const call_grapht::directed_grapht &graph, const irep_idt &function)
Get functions that can reach a given function.