23 std::set<irep_idt> result;
25 const auto &neighbours = forwards ? fnode.
out : fnode.in;
26 for(
const auto &succ_edge : neighbours)
27 result.insert(graph[succ_edge.first].function);
54 std::vector<call_grapht::directed_grapht::node_indext> connected_nodes =
56 std::set<irep_idt> result;
57 for(
const auto i : connected_nodes)
58 result.insert(graph[i].
function);
std::set< irep_idt > get_callers(const call_grapht::directed_grapht &graph, const irep_idt &function)
Get functions that call a given function.
static std::set< irep_idt > get_connected_functions(const call_grapht::directed_grapht &graph, const irep_idt &function, bool forwards)
Get either reachable functions or functions that can reach a given function.
static std::set< irep_idt > get_neighbours(const call_grapht::directed_grapht &graph, const irep_idt &function, bool forwards)
Get either callers or callees of a given function.
optionalt< node_indext > get_node_index(const irep_idt &function) const
Find the graph node by function name.
const edgest & out(node_indext n) const
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.
Directed graph representation of this call graph.
std::set< irep_idt > get_reachable_functions(const call_grapht::directed_grapht &graph, const irep_idt &function)
Get functions reachable from a given function.
Function Call Graph Helpers.
std::set< irep_idt > get_callees(const call_grapht::directed_grapht &graph, const irep_idt &function)
Get functions directly callable from a given function.
std::vector< node_indext > get_reachable(node_indext src, bool forwards) const
Run depth-first search on the graph, starting from a single source node.