ROSE
0.11.109.0
|
Control flow graph vertex.
Definition at line 28 of file ControlFlowGraph.h.
#include <Rose/BinaryAnalysis/Partitioner2/ControlFlowGraph.h>
Public Member Functions | |
CfgVertex (rose_addr_t startVa) | |
Construct a basic block placeholder vertex. More... | |
CfgVertex (const BasicBlock::Ptr &bb) | |
Construct a basic block vertex. More... | |
CfgVertex (VertexType type) | |
Construct a special vertex. More... | |
VertexType | type () const |
Returns the vertex type. More... | |
Sawyer::Optional< rose_addr_t > | optionalAddress () const |
Safe version of starting address. More... | |
Sawyer::Optional< rose_addr_t > | optionalLastAddress () const |
Address of last item in the vertex. More... | |
AddressIntervalSet | addresses () const |
Compute entire address set. More... | |
bool | insertOwningFunction (const Function::Ptr &function) |
Add a function to the list of functions that own this vertex. More... | |
void | eraseOwningFunction (const Function::Ptr &function) |
Remove a function from the list of functions that own this vertex. More... | |
bool | isOwningFunction (const Function::Ptr &function) const |
Determines if a function owns this vertex. More... | |
size_t | nOwningFunctions () const |
Number of functions that own this vertex. More... | |
Function::Ptr | isEntryBlock () const |
Is block a function entry block? More... | |
void | nullify () |
Turns a basic block vertex into a placeholder. More... | |
rose_addr_t | address () const |
Property: starting address. More... | |
void | address (rose_addr_t va) |
Property: starting address. More... | |
const BasicBlock::Ptr & | bblock () const |
Property: basic block. More... | |
void | bblock (const BasicBlock::Ptr &bb) |
Property: basic block. More... | |
const FunctionSet & | owningFunctions () const |
Property: Owning functions. More... | |
FunctionSet & | owningFunctions () |
Property: Owning functions. More... | |
|
inlineexplicit |
Construct a basic block placeholder vertex.
Definition at line 54 of file ControlFlowGraph.h.
|
inlineexplicit |
Construct a basic block vertex.
Definition at line 57 of file ControlFlowGraph.h.
|
inline |
Construct a special vertex.
Definition at line 63 of file ControlFlowGraph.h.
References Rose::BinaryAnalysis::Partitioner2::V_BASIC_BLOCK.
|
inline |
Returns the vertex type.
Definition at line 68 of file ControlFlowGraph.h.
|
inline |
Property: starting address.
The virtual address for a placeholder or basic block. User-defined vertices can use this for whatever they want. Calling this for a vertex that's not a basic block or user defined type results in undefined behavior.
See also, optionalAddress.
Definition at line 78 of file ControlFlowGraph.h.
References Rose::BinaryAnalysis::Partitioner2::V_BASIC_BLOCK, Rose::BinaryAnalysis::Partitioner2::V_NONEXISTING, and Rose::BinaryAnalysis::Partitioner2::V_USER_DEFINED.
|
inline |
Property: starting address.
The virtual address for a placeholder or basic block. User-defined vertices can use this for whatever they want. Calling this for a vertex that's not a basic block or user defined type results in undefined behavior.
See also, optionalAddress.
Definition at line 82 of file ControlFlowGraph.h.
References Rose::BinaryAnalysis::Partitioner2::V_BASIC_BLOCK, Rose::BinaryAnalysis::Partitioner2::V_NONEXISTING, and Rose::BinaryAnalysis::Partitioner2::V_USER_DEFINED.
Sawyer::Optional<rose_addr_t> Rose::BinaryAnalysis::Partitioner2::CfgVertex::optionalAddress | ( | ) | const |
Safe version of starting address.
This is the same as address but doesn't fail if there is no address.
Sawyer::Optional<rose_addr_t> Rose::BinaryAnalysis::Partitioner2::CfgVertex::optionalLastAddress | ( | ) | const |
Address of last item in the vertex.
If the vertex is a basic block with more than one instruction, then return the address of its last instruction. Otherwise, this is the same as optionalAddress.
AddressIntervalSet Rose::BinaryAnalysis::Partitioner2::CfgVertex::addresses | ( | ) | const |
Compute entire address set.
Constructs and returns an address set containing all addresses represented by this vertex. For basic block vertices, this is the union of the addresses occupied by the instructions (not just the starting address of each instruction). For user-defined vertices, this method returns a singleton address. All other vertex types return an empty set since it is generally their predecessors that have addresses (e.g., each undiscovered basic block is a basic-block CFG vertex whose successor is the special "undiscovered" vertex which has no distinct address.
|
inline |
Property: basic block.
Pointer to a basic block. This property is available for V_BASIC_BLOCK or V_USER_DEFINED vertices. A V_BASIC_BLOCK vertex with a null bblock property is called a "placeholder". Other types of vertices are not allowed to set a basic block, and will always return a null pointer.
Definition at line 115 of file ControlFlowGraph.h.
|
inline |
Property: basic block.
Pointer to a basic block. This property is available for V_BASIC_BLOCK or V_USER_DEFINED vertices. A V_BASIC_BLOCK vertex with a null bblock property is called a "placeholder". Other types of vertices are not allowed to set a basic block, and will always return a null pointer.
Definition at line 118 of file ControlFlowGraph.h.
References Rose::BinaryAnalysis::Partitioner2::V_BASIC_BLOCK, and Rose::BinaryAnalysis::Partitioner2::V_USER_DEFINED.
|
inline |
Add a function to the list of functions that own this vertex.
Returns true if the function was added, false if it was already an owner of the vertex.
Definition at line 127 of file ControlFlowGraph.h.
References Sawyer::Container::Set< T, C, A >::insert(), Rose::BinaryAnalysis::Partitioner2::V_BASIC_BLOCK, Rose::BinaryAnalysis::Partitioner2::V_NONEXISTING, and Rose::BinaryAnalysis::Partitioner2::V_USER_DEFINED.
|
inline |
Remove a function from the list of functions that own this vertex.
Causes the specified function to no longer be listed as an owner of this vertex. Does nothing if the function is not an owner to begin with.
Definition at line 137 of file ControlFlowGraph.h.
References Sawyer::Container::Set< T, C, A >::erase(), Rose::BinaryAnalysis::Partitioner2::V_BASIC_BLOCK, Rose::BinaryAnalysis::Partitioner2::V_NONEXISTING, and Rose::BinaryAnalysis::Partitioner2::V_USER_DEFINED.
|
inline |
Determines if a function owns this vertex.
Returns true if the specified function is listed as an owning function of this vertex, false otherwise.
Definition at line 146 of file ControlFlowGraph.h.
References Sawyer::Container::Set< T, C, A >::exists().
|
inline |
Number of functions that own this vertex.
Definition at line 151 of file ControlFlowGraph.h.
References Sawyer::Container::Set< T, C, A >::size().
|
inline |
Property: Owning functions.
Certain kinds of vertices can be owned by zero or more functions, and this property holds the set of such functions. See also, insertOwningFunction, eraseOwningFunction, and isOwningFunction. This property is available for V_BASIC_BLOCK and V_USER_DEFINED vertices.
Definition at line 162 of file ControlFlowGraph.h.
|
inline |
Property: Owning functions.
Certain kinds of vertices can be owned by zero or more functions, and this property holds the set of such functions. See also, insertOwningFunction, eraseOwningFunction, and isOwningFunction. This property is available for V_BASIC_BLOCK and V_USER_DEFINED vertices.
Definition at line 165 of file ControlFlowGraph.h.
Function::Ptr Rose::BinaryAnalysis::Partitioner2::CfgVertex::isEntryBlock | ( | ) | const |
Is block a function entry block?
Returns true (a non-null function pointer) if this block serves as the entry block for some function.
|
inline |
Turns a basic block vertex into a placeholder.
The basic block pointer is reset to null.
Definition at line 178 of file ControlFlowGraph.h.
References Rose::BinaryAnalysis::Partitioner2::V_BASIC_BLOCK.