Partitioner::BasicBlock Struct Reference

#include <Partitioner.h>

Collaboration diagram for Partitioner::BasicBlock:

Collaboration graph
[legend]
List of all members.

Detailed Description

Represents a basic block within the Partitioner.

Each basic block will eventually become an SgAsmBlock node in the AST. However, if the SgAsmFunction::FUNC_LEFTOVER bit is set in the Partitioner::set_search() method then blocks that were not assigned to any function to not result in an SgAsmBlock node.

The first instruction of a basic block should never change. In particular, the address of the first instruction should not change because this address is used as a key to link a BasicBlock object to a Function object.


Public Member Functions

 BasicBlock ()
 Constructor.
 ~BasicBlock ()
 Destructor.
bool valid_cache () const
 Returns true if the block analysis cache is up to date.
void invalidate_cache ()
 Marks the block analysis cache as being outdated.
void validate_cache ()
 Marks the block analysis cache as being up to date.
void clear_data_blocks ()
 Remove all data blocks from this basic block.
Instructionlast_insn () const
 Returns the last executed (exit) instruction of the block.
rose_addr_t address () const
 Returns the first address of a basic block.

Public Attributes

unsigned reason
 Reasons this block was created; SgAsmBlock::Reason bit flags.
std::vector< Instruction * > insns
 Non-empty set of instructions composing this basic block, in address order.
std::set< DataBlock * > data_blocks
 Data blocks owned by this basic block.
BlockAnalysisCache cache
 Cached results of local analyses.
Functionfunction
 Function to which this basic block is assigned, or null.
double code_likelihood
 Likelihood (0.


Constructor & Destructor Documentation

Partitioner::BasicBlock::BasicBlock (  )  [inline]

Constructor.

This constructor should not be called directly since the Partitioner has other pointers that it needs to establish to this block. Instead, call Partitioner::find_bb_containing().

Partitioner::BasicBlock::~BasicBlock (  )  [inline]

Destructor.

This destructor should not be called directly since there are other pointers to this block that the block does not know about. Instead, call Partitioner::discard().


Member Function Documentation

bool Partitioner::BasicBlock::valid_cache (  )  const [inline]

Returns true if the block analysis cache is up to date.

void Partitioner::BasicBlock::invalidate_cache (  )  [inline]

Marks the block analysis cache as being outdated.

void Partitioner::BasicBlock::validate_cache (  )  [inline]

Marks the block analysis cache as being up to date.

void Partitioner::BasicBlock::clear_data_blocks (  ) 

Remove all data blocks from this basic block.

The data blocks continue to exist, they're just no longer associated with this basic block.

Partitioner::Instruction * Partitioner::BasicBlock::last_insn (  )  const

Returns the last executed (exit) instruction of the block.

rose_addr_t Partitioner::BasicBlock::address (  )  const

Returns the first address of a basic block.

Since the instructions of a basic block are not necessarily monotonically increasing, the first address might not be the lowest address.


Member Data Documentation

unsigned Partitioner::BasicBlock::reason

Reasons this block was created; SgAsmBlock::Reason bit flags.

std::vector<Instruction*> Partitioner::BasicBlock::insns

Non-empty set of instructions composing this basic block, in address order.

std::set<DataBlock*> Partitioner::BasicBlock::data_blocks

Data blocks owned by this basic block.

E.g., this block's jump table.

BlockAnalysisCache Partitioner::BasicBlock::cache

Cached results of local analyses.

Function* Partitioner::BasicBlock::function

Function to which this basic block is assigned, or null.

double Partitioner::BasicBlock::code_likelihood

Likelihood (0.

.1) that this is code. One unless detected statistically.


The documentation for this struct was generated from the following files:
Generated on Tue Jan 31 05:34:18 2012 for ROSE by  doxygen 1.4.7