ROSE
0.9.6a
|
Represents a basic block within the Partitioner. More...
#include <Partitioner.h>
Public Member Functions | |
BasicBlock () | |
Constructor. More... | |
~BasicBlock () | |
Destructor. More... | |
bool | valid_cache () const |
Returns true if the block analysis cache is up to date. More... | |
void | invalidate_cache () |
Marks the block analysis cache as being outdated. More... | |
void | validate_cache () |
Marks the block analysis cache as being up to date. More... | |
void | clear_data_blocks () |
Remove all data blocks from this basic block. More... | |
Instruction * | last_insn () const |
Returns the last executed (exit) instruction of the block. More... | |
rose_addr_t | address () const |
Returns the first address of a basic block. More... | |
Public Attributes | |
unsigned | reason |
Reasons this block was created; SgAsmBlock::Reason bit flags. More... | |
std::vector< Instruction * > | insns |
Non-empty set of instructions composing this basic block, in address order. More... | |
std::set< DataBlock * > | data_blocks |
Data blocks owned by this basic block. More... | |
BlockAnalysisCache | cache |
Cached results of local analyses. More... | |
Function * | function |
Function to which this basic block is assigned, or null. More... | |
double | code_likelihood |
Likelihood (0..1) that this is code. More... | |
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.
Definition at line 215 of file Partitioner.h.
|
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().
Definition at line 218 of file Partitioner.h.
|
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().
Definition at line 222 of file Partitioner.h.
|
inline |
Returns true if the block analysis cache is up to date.
Definition at line 225 of file Partitioner.h.
References Partitioner::BlockAnalysisCache::age, cache, and insns.
Referenced by Partitioner::update_analyses().
|
inline |
Marks the block analysis cache as being outdated.
Definition at line 228 of file Partitioner.h.
References Partitioner::BlockAnalysisCache::age, and cache.
|
inline |
Marks the block analysis cache as being up to date.
Definition at line 231 of file Partitioner.h.
References Partitioner::BlockAnalysisCache::age, cache, and insns.
Referenced by Partitioner::update_analyses().
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.
Definition at line 525 of file Partitioner.C.
Referenced by Partitioner::discard(), and Partitioner::truncate().
Partitioner::Instruction * Partitioner::BasicBlock::last_insn | ( | ) | const |
Returns the last executed (exit) instruction of the block.
Definition at line 517 of file Partitioner.C.
Referenced by Partitioner::analyze_cfg(), Partitioner::discover_jump_table(), Partitioner::successors(), and Partitioner::update_analyses().
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.
Definition at line 487 of file Partitioner.C.
Referenced by Partitioner::analyze_cfg(), Partitioner::append(), Partitioner::build_ast(), Partitioner::discard(), Partitioner::discover_blocks(), Partitioner::discover_first_block(), Partitioner::find_bb_starting(), Partitioner::FindInsnPadding::operator()(), Partitioner::FindThunks::operator()(), Partitioner::FindPostFunctionInsns::operator()(), Partitioner::post_cfg(), and Partitioner::remove().
unsigned Partitioner::BasicBlock::reason |
Reasons this block was created; SgAsmBlock::Reason bit flags.
Definition at line 239 of file Partitioner.h.
Referenced by Partitioner::append(), Partitioner::build_ast(), Partitioner::detach_thunk(), and Partitioner::post_cfg().
std::vector<Instruction*> Partitioner::BasicBlock::insns |
Non-empty set of instructions composing this basic block, in address order.
Definition at line 240 of file Partitioner.h.
Referenced by Partitioner::append(), Partitioner::build_ast(), Partitioner::detach_thunk(), Partitioner::discard(), Partitioner::discover_blocks(), Partitioner::discover_first_block(), Partitioner::discover_jump_table(), Partitioner::find_bb_starting(), Partitioner::function_extent(), Partitioner::is_pe_dynlink_thunk(), Partitioner::is_thunk(), Partitioner::mark_ipd_configuration(), Partitioner::FindInsnPadding::operator()(), Partitioner::FindFunctionFragments::operator()(), Partitioner::FindThunks::operator()(), Partitioner::FindThunkTables::operator()(), Partitioner::FindPostFunctionInsns::operator()(), Partitioner::truncate(), Partitioner::update_analyses(), valid_cache(), and validate_cache().
std::set<DataBlock*> Partitioner::BasicBlock::data_blocks |
Data blocks owned by this basic block.
E.g., this block's jump table.
Definition at line 241 of file Partitioner.h.
Referenced by Partitioner::append(), Partitioner::build_ast(), Partitioner::function_extent(), and Partitioner::remove().
BlockAnalysisCache Partitioner::BasicBlock::cache |
Cached results of local analyses.
Definition at line 242 of file Partitioner.h.
Referenced by Partitioner::append(), Partitioner::call_target(), Partitioner::canonic_block(), invalidate_cache(), Partitioner::is_function_call(), Partitioner::mark_ipd_configuration(), Partitioner::successors(), Partitioner::update_analyses(), valid_cache(), and validate_cache().
Function* Partitioner::BasicBlock::function |
Function to which this basic block is assigned, or null.
Definition at line 243 of file Partitioner.h.
Referenced by Partitioner::analyze_cfg(), Partitioner::append(), Partitioner::build_ast(), Partitioner::detach_thunk(), Partitioner::discard(), Partitioner::discover_blocks(), Partitioner::discover_first_block(), Partitioner::effective_function(), Partitioner::find_bb_starting(), Partitioner::fixup_pointers(), Partitioner::is_contiguous(), Partitioner::merge_function_fragments(), Partitioner::FindInsnPadding::operator()(), Partitioner::FindFunctionFragments::operator()(), Partitioner::FindPostFunctionInsns::operator()(), Partitioner::post_cfg(), Partitioner::remove(), Partitioner::scan_interfunc_insns(), Partitioner::scan_intrafunc_insns(), Partitioner::scan_unassigned_insns(), and Partitioner::successors().
double Partitioner::BasicBlock::code_likelihood |
Likelihood (0..1) that this is code.
One unless detected statistically.
Definition at line 244 of file Partitioner.h.
Referenced by Partitioner::build_ast().