ROSE  0.9.9.109
Public Member Functions | List of all members
Rose::BinaryAnalysis::Partitioner2::CfgVertex Class Reference

Description

Control flow graph vertex.

Definition at line 21 of file ControlFlowGraph.h.

#include <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...
 
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::Ptrbblock () const
 Property: basic block. More...
 
void bblock (const BasicBlock::Ptr &bb)
 Property: basic block. More...
 
const FunctionSetowningFunctions () const
 Property: Owning functions. More...
 
FunctionSetowningFunctions ()
 Property: Owning functions. More...
 

Constructor & Destructor Documentation

Rose::BinaryAnalysis::Partitioner2::CfgVertex::CfgVertex ( rose_addr_t  startVa)
inlineexplicit

Construct a basic block placeholder vertex.

Definition at line 47 of file ControlFlowGraph.h.

Rose::BinaryAnalysis::Partitioner2::CfgVertex::CfgVertex ( const BasicBlock::Ptr bb)
inlineexplicit

Construct a basic block vertex.

Definition at line 50 of file ControlFlowGraph.h.

Rose::BinaryAnalysis::Partitioner2::CfgVertex::CfgVertex ( VertexType  type)
inline

Construct a special vertex.

Definition at line 56 of file ControlFlowGraph.h.

References Rose::BinaryAnalysis::Partitioner2::V_BASIC_BLOCK.

Member Function Documentation

VertexType Rose::BinaryAnalysis::Partitioner2::CfgVertex::type ( ) const
inline

Returns the vertex type.

Definition at line 61 of file ControlFlowGraph.h.

rose_addr_t Rose::BinaryAnalysis::Partitioner2::CfgVertex::address ( ) const
inline

Property: starting address.

The virtual address for a placeholder or basic block. User-defined vertices can use this for whatever they want.

Definition at line 68 of file ControlFlowGraph.h.

References Rose::BinaryAnalysis::Partitioner2::V_BASIC_BLOCK, and Rose::BinaryAnalysis::Partitioner2::V_USER_DEFINED.

void Rose::BinaryAnalysis::Partitioner2::CfgVertex::address ( rose_addr_t  va)
inline

Property: starting address.

The virtual address for a placeholder or basic block. User-defined vertices can use this for whatever they want.

Definition at line 72 of file ControlFlowGraph.h.

References Rose::BinaryAnalysis::Partitioner2::V_BASIC_BLOCK, and Rose::BinaryAnalysis::Partitioner2::V_USER_DEFINED.

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.

const BasicBlock::Ptr& Rose::BinaryAnalysis::Partitioner2::CfgVertex::bblock ( ) const
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".

Definition at line 93 of file ControlFlowGraph.h.

References Rose::BinaryAnalysis::Partitioner2::V_BASIC_BLOCK, and Rose::BinaryAnalysis::Partitioner2::V_USER_DEFINED.

void Rose::BinaryAnalysis::Partitioner2::CfgVertex::bblock ( const BasicBlock::Ptr bb)
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".

Definition at line 97 of file ControlFlowGraph.h.

References Rose::BinaryAnalysis::Partitioner2::V_BASIC_BLOCK, and Rose::BinaryAnalysis::Partitioner2::V_USER_DEFINED.

bool Rose::BinaryAnalysis::Partitioner2::CfgVertex::insertOwningFunction ( const Function::Ptr function)
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 106 of file ControlFlowGraph.h.

References Sawyer::Container::Set< T, C, A >::insert(), Rose::BinaryAnalysis::Partitioner2::V_BASIC_BLOCK, and Rose::BinaryAnalysis::Partitioner2::V_USER_DEFINED.

void Rose::BinaryAnalysis::Partitioner2::CfgVertex::eraseOwningFunction ( const Function::Ptr function)
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 116 of file ControlFlowGraph.h.

References Sawyer::Container::Set< T, C, A >::erase(), Rose::BinaryAnalysis::Partitioner2::V_BASIC_BLOCK, and Rose::BinaryAnalysis::Partitioner2::V_USER_DEFINED.

bool Rose::BinaryAnalysis::Partitioner2::CfgVertex::isOwningFunction ( const Function::Ptr function) const
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 125 of file ControlFlowGraph.h.

References Sawyer::Container::Set< T, C, A >::exists().

size_t Rose::BinaryAnalysis::Partitioner2::CfgVertex::nOwningFunctions ( ) const
inline

Number of functions that own this vertex.

Definition at line 130 of file ControlFlowGraph.h.

References Sawyer::Container::Set< T, C, A >::size().

const FunctionSet& Rose::BinaryAnalysis::Partitioner2::CfgVertex::owningFunctions ( ) const
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 141 of file ControlFlowGraph.h.

FunctionSet& Rose::BinaryAnalysis::Partitioner2::CfgVertex::owningFunctions ( )
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 144 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.

void Rose::BinaryAnalysis::Partitioner2::CfgVertex::nullify ( )
inline

Turns a basic block vertex into a placeholder.

The basic block pointer is reset to null.

Definition at line 157 of file ControlFlowGraph.h.

References Rose::BinaryAnalysis::Partitioner2::V_BASIC_BLOCK.


The documentation for this class was generated from the following file: