Interface to information about a routine in an image. More...
#include <dcfg_api.H>
Public Member Functions | |
virtual DCFG_ID | get_process_id () const =0 |
Get the process ID. | |
virtual DCFG_ID | get_image_id () const =0 |
Get the image ID. | |
virtual DCFG_ID | get_routine_id () const =0 |
Get routine ID, which equals the basic-block ID of the entry node. | |
virtual const std::string * | get_symbol_name () const =0 |
Get symbol name of this routine. | |
virtual UINT32 | get_entry_edge_ids (DCFG_ID_CONTAINER &edge_ids) const =0 |
Get set of entry edge IDs. | |
virtual UINT32 | get_exit_edge_ids (DCFG_ID_CONTAINER &edge_ids) const =0 |
Get set of exit edge IDs. | |
virtual DCFG_ID | get_idom_node_id (DCFG_ID node_id) const =0 |
Get immediate dominator. | |
virtual UINT64 | get_entry_count () const =0 |
Get dynamic entry count. | |
virtual UINT64 | get_entry_count_for_thread (UINT32 thread_id) const =0 |
Get dynamic entry count per thread. | |
![]() | |
virtual UINT32 | get_loop_ids (DCFG_ID_CONTAINER &node_ids) const =0 |
Get the set of loop IDs. | |
virtual DCFG_LOOP_CPTR | get_loop_info (DCFG_ID loop_id) const =0 |
Get access to data for a loop. | |
![]() | |
virtual UINT32 | get_basic_block_ids (DCFG_ID_CONTAINER &node_ids) const =0 |
Get IDs of all basic blocks in the structure. | |
virtual UINT32 | get_internal_edge_ids (DCFG_ID_CONTAINER &edge_ids) const =0 |
Get list of internal edge IDs. | |
virtual UINT32 | get_inbound_edge_ids (DCFG_ID_CONTAINER &edge_ids) const =0 |
Get list of in-bound edge IDs. | |
virtual UINT32 | get_outbound_edge_ids (DCFG_ID_CONTAINER &edge_ids) const =0 |
Get list of out-bound edge IDs. | |
virtual UINT64 | get_instr_count () const =0 |
Get the total dynamic instruction count. | |
virtual UINT64 | get_instr_count_for_thread (UINT32 thread_id) const =0 |
Get per-thread dynamic instruction count. | |
Interface to information about a routine in an image.
A routine is also known as a subroutine, function, or procedure.
|
pure virtual |
Get dynamic entry count.
This is the number of times the routine was called or otherwise entered. By the DCFG definition, a routine can only be entered at its entry node. A call within a routine to its entry node is considered an entry (via recursion). If there is a branch within a routine to its entry node, it will also be considered an entry (this is unusual).
|
pure virtual |
Get dynamic entry count per thread.
See DCFG_ROUTINE::get_entry_count() for entry-count definition.
[in] | thread_id | Thread number. Typically, threads are consecutively numbered from zero to DCFG_PROCESS::get_highest_thread_id(). |
|
pure virtual |
Get set of entry edge IDs.
For routines, these are typically from "call" statements, but they can also include branches to routines for unstructured code. The source of an entry edge will be from another routine except in the case of direct recursion (call from routine to itself). The target of an entry edge will always be the entry node. This set does not include incoming return edges. If you also want return edges, use DCFG_GRAPH_BASE::get_inbound_edge_ids().
edge_ids
. [out] | edge_ids | Container to which exit edge IDs are added. Previous contents of the container are not emptied by this call, so it should be emptied by the programmer before the call if desired. The programmer can use any implementation of DCFG_ID_CONTAINER: DCFG_ID_VECTOR, DCFG_ID_SET, etc. |
|
pure virtual |
Get set of exit edge IDs.
For routines, these are typically from "return" statements, but they can also include branches out of routines for unstructured code. The target of an exit edge will be to another routine except for direct recursion. This set does not include outgoing call edges. If you also want call edges, use DCFG_GRAPH_BASE::get_outbound_edge_ids().
edge_ids
. [out] | edge_ids | Container to which exit edge IDs are added. Previous contents of the container are not emptied by this call, so it should be emptied by the programmer before the call if desired. The programmer can use any implementation of DCFG_ID_CONTAINER: DCFG_ID_VECTOR, DCFG_ID_SET, etc. |
|
pure virtual |
Get immediate dominator.
The immediate dominator (idom) is the last node before the given node that must be executed before the given node is executed. The idom of the entry node is itself. The idom must be within the routine, i.e., it does not consider edges between routines. Idoms relationships are used in many graph algorithms.
node_id
or zero (0) if node_id
is not in this routine. [in] | node_id | ID number of dominated node. |
|
pure virtual |
Get the image ID.
|
pure virtual |
Get the process ID.
|
pure virtual |
Get routine ID, which equals the basic-block ID of the entry node.
By the DCFG definition, a routine can only have one entry node. If there is a call into the "middle" of a routine, that entry point defines a separate routine in a DCFG.
|
pure virtual |
Get symbol name of this routine.
For more comprehensive symbol and source-code data, use DCFG_BASIC_BLOCK::get_symbol_name(), DCFG_BASIC_BLOCK::get_source_filename(), and DCFG_BASIC_BLOCK::get_source_line_number() for one or more basic blocks in this routine.
NULL
otherwise.