Loading...
Searching...
No Matches
call_graph_helpers.cpp File Reference
Function Call Graph Helpers.
More...
+ Include dependency graph for call_graph_helpers.cpp:
Go to the source code of this file.
Get either callers or callees of a given function.
Get functions directly callable from a given function.
Get functions that call a given function.
Get either reachable functions or functions that can reach a given function.
Get functions reachable from a given function.
Get functions that can reach a given function.
Get either callers or callees reachable from a given list of functions within N steps.
Get either callers or callees reachable from a given list of functions within N steps.
Disconnects all functions in the call graph that are unreachable from a given start function.
Get list of functions on the shortest path between two functions.
Detailed Description
Function Documentation
◆ disconnect_unreachable_functions()
Disconnects all functions in the call graph that are unreachable from a given start function.
Removing nodes requires re-indexing, so instead we disconnect them, removing all in and out edges from those nodes. This speeds up backwards reachability.
- Parameters
-
graph call graph
function start function
Definition at line 100 of file call_graph_helpers.cpp.
◆ get_callees()
Get functions directly callable from a given function.
- Parameters
-
graph call graph
function function to query
- Returns
- set of called functions
Definition at line 31 of file call_graph_helpers.cpp.
◆ get_callers()
Get functions that call a given function.
- Parameters
-
graph call graph
function function to query
- Returns
- set of caller functions
Definition at line 37 of file call_graph_helpers.cpp.
◆ get_connected_functions()
Get either reachable functions or functions that can reach a given function.
In both cases the query function itself is included.
- Parameters
-
graph call graph
function function to query
forwards if true, get reachable functions; otherwise get functions that can reach the given function.
Definition at line 49 of file call_graph_helpers.cpp.
◆ get_functions_reachable_within_n_steps() [1/2]
Get either callers or callees reachable from a given list of functions within N steps.
- Parameters
-
graph call graph
start_function single start function
n number of steps to consider
- Returns
- set of functions that can be reached from the start function including the start function
Definition at line 91 of file call_graph_helpers.cpp.
◆ get_functions_reachable_within_n_steps() [2/2]
Get either callers or callees reachable from a given list of functions within N steps.
- Parameters
-
graph call graph
start_functions set of start functions
n number of steps to consider
- Returns
- set of functions that can be reached from the start function including the start function
Definition at line 74 of file call_graph_helpers.cpp.
◆ get_neighbours()
Get either callers or callees of a given function.
- Parameters
-
graph call graph
function function to query
forwards if true, get callees; otherwise get callers.
Definition at line 18 of file call_graph_helpers.cpp.
◆ get_reachable_functions()
Get functions reachable from a given function.
- Parameters
-
graph call graph
function function to query
- Returns
- set of reachable functions, including
function
Definition at line 62 of file call_graph_helpers.cpp.
◆ get_reaching_functions()
Get functions that can reach a given function.
- Parameters
-
graph call graph
function function to query
- Returns
- set of functions that can reach the target, including
function
Definition at line 68 of file call_graph_helpers.cpp.
◆ get_shortest_function_path()
Get list of functions on the shortest path between two functions.
- Parameters
-
graph call graph
src function to start from
dest function to reach
- Returns
- list of functions on shortest path
Definition at line 107 of file call_graph_helpers.cpp.