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

Description

Control flow graph vertex.

Definition at line 26 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 BasicBlockPtr &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 FunctionPtr &)
 Add a function to the list of functions that own this vertex. More...
 
void eraseOwningFunction (const FunctionPtr &)
 Remove a function from the list of functions that own this vertex. More...
 
bool isOwningFunction (const FunctionPtr &) const
 Determines if a function owns this vertex. More...
 
size_t nOwningFunctions () const
 Number of functions that own this vertex. More...
 
FunctionPtr 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)
 Property: starting address. More...
 
const BasicBlockPtrbblock () const
 Property: basic block. More...
 
void bblock (const BasicBlockPtr &)
 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)
explicit

Construct a basic block placeholder vertex.

Rose::BinaryAnalysis::Partitioner2::CfgVertex::CfgVertex ( const BasicBlockPtr bb)
explicit

Construct a basic block vertex.

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

Construct a special vertex.

Member Function Documentation

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

Returns the vertex type.

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

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.

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

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.

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.

const BasicBlockPtr& Rose::BinaryAnalysis::Partitioner2::CfgVertex::bblock ( ) const

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.

void Rose::BinaryAnalysis::Partitioner2::CfgVertex::bblock ( const BasicBlockPtr )

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.

bool Rose::BinaryAnalysis::Partitioner2::CfgVertex::insertOwningFunction ( const FunctionPtr )

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.

void Rose::BinaryAnalysis::Partitioner2::CfgVertex::eraseOwningFunction ( const FunctionPtr )

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.

bool Rose::BinaryAnalysis::Partitioner2::CfgVertex::isOwningFunction ( const FunctionPtr ) const

Determines if a function owns this vertex.

Returns true if the specified function is listed as an owning function of this vertex, false otherwise.

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

Number of functions that own this vertex.

const FunctionSet& Rose::BinaryAnalysis::Partitioner2::CfgVertex::owningFunctions ( ) const

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.

FunctionSet& Rose::BinaryAnalysis::Partitioner2::CfgVertex::owningFunctions ( )

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.

FunctionPtr 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 ( )

Turns a basic block vertex into a placeholder.

The basic block pointer is reset to null.


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