![]() |
OTAWA
2.0
Framework to perform machine analysis and compute WCET.
|
#include <otawa/cfg/CFG.h>
Classes | |
class | BundleIter |
class | InstIter |
Public Types | |
typedef Vector< Pair< BasicBlock *, Edge * > > | basic_preds_t |
typedef BaseBundle< InstIter > | Bundle |
![]() | |
typedef edges_t::Iter | EdgeIter |
typedef elm::List< Edge * > | edges_t |
Public Member Functions | |
Address | address (void) const |
MemArea | area (void) const |
BasicBlock (const Array< Inst * > &insts) | |
Build a basic block. More... | |
void | basicPreds (basic_preds_t &preds) |
Compute the predecessors of the current basic block that (a) are basic blocks and (b)for which transition can be accounted by an edge. More... | |
InstIter | begin (void) const |
Iterable< BundleIter > | bundles () const |
bool | contains (Address addr) |
bool | contains (Inst *i) |
Test if the current BB contains the given instruction. More... | |
bool | contains (Inst *i) const |
Inst * | control (void) |
Get the control instruction of the block (if any). More... | |
int | count (void) const |
Count the number of instructions in the block. More... | |
InstIter | end (void) const |
Inst * | first (void) const |
InstIter | insts (void) const |
Inst * | last (void) |
Get the last instruction of the block. More... | |
bool | overlap (BasicBlock *bb) const |
bool | overlap (const MemArea &area) const |
int | size (void) const |
Get size of the basic block. More... | |
Address | topAddress (void) const |
~BasicBlock (void) | |
![]() | |
Address | address (void) const |
CFG * | cfg (void) const |
int | id (void) const |
bool | isBasic (void) const |
bool | isCall (void) const |
bool | isEnd (void) const |
bool | isEntry (void) const |
bool | isExit (void) const |
bool | isPhony (void) const |
bool | isSynth (void) const |
bool | isUnknown (void) const |
bool | isVirtual (void) const |
operator BasicBlock * (void) | |
operator SynthBlock * (void) | |
BasicBlock * | toBasic (void) |
const BasicBlock * | toBasic (void) const |
SynthBlock * | toSynth (void) |
const SynthBlock * | toSynth (void) const |
![]() | |
void | addProp (Property *prop) |
Add property to the list without checking of duplication. More... | |
void | addProps (const PropList &props) |
Add all properties from the given property list, in a reverse order. More... | |
GetterRange | all (const AbstractIdentifier &id) const |
void | clearProps (void) |
Remove all properties from the list. More... | |
Property * | extractProp (const AbstractIdentifier &id) |
Property * | extractProp (const AbstractIdentifier *id) |
Remove a property matching the given identifier and return it. More... | |
Property * | getProp (const AbstractIdentifier *id) const |
Find a property by its identifier. More... | |
bool | hasProp (const AbstractIdentifier &id) const |
PropList & | operator= (const PropList &props) |
void | print (elm::io::Output &out) const |
Display the current property list. More... | |
PropRange | properties (void) const |
PropList (const PropList &props) | |
Initialize a property list from a sequence of (identifier, value) pairs passed as variable arguments. More... | |
PropList (void) | |
void | removeAllProp (const AbstractIdentifier *id) |
Remove all the properties matching the given identifier. More... | |
void | removeProp (const AbstractIdentifier &id) |
void | removeProp (const AbstractIdentifier *id) |
Remove a property matching the given identifier. More... | |
void | setProp (const AbstractIdentifier *id) |
void | setProp (Property *prop) |
Set the property in the property list removing any double. More... | |
void | takeProps (PropList &props) |
Take properties from props to the current property list. More... | |
~PropList (void) | |
![]() | |
EdgeCollection | inEdges (void) const |
EdgeIter | ins (void) const |
EdgeCollection | outEdges (void) const |
EdgeIter | outs (void) const |
PredCollection | preds (void) const |
SuccCollection | succs (void) const |
![]() | |
int | countIns (void) const |
int | countOuts (void) const |
int | index (void) const |
const edges_t & | inEdges (void) const |
EdgeIter | ins (void) const |
const edges_t & | outEdges (void) const |
EdgeIter | outs (void) const |
Vertex (void) | |
Private Attributes | |
AllocArray< Inst * > | _insts |
Additional Inherited Members | |
![]() | |
static const t::uint16 | IS_BASIC = 1 << 0 |
static const t::uint16 | IS_CALL = 0x2 << 0 |
static const t::uint16 | IS_ENTRY = 0 << 2 |
static const t::uint16 | IS_EXIT = 1 << 2 |
static const t::uint16 | IS_PHONY = 3 << 2 |
static const t::uint16 | IS_SYNTH = 2 << 0 |
static const t::uint16 | IS_UNKN = 2 << 2 |
static const t::uint16 | IS_VIRTUAL = 0 << 0 |
static const t::uint16 | MASK1 = 0x3 |
static const t::uint16 | MASK12 = MASK1 | (0x3 << 2) |
![]() | |
static rtti::Type & | __type = prop_list_class |
static const PropList | EMPTY |
This is an empty proplist for convenience. More... | |
![]() | |
Block (t::uint16 type=IS_BASIC) | |
Build a CFG block. More... | |
![]() | |
~Vertex (void) | |
A basic block of the CFG.
typedef Vector<Pair<BasicBlock *, Edge *> > otawa::BasicBlock::basic_preds_t |
typedef BaseBundle<InstIter> otawa::BasicBlock::Bundle |
Build a basic block.
instructions | Array of instructions. |
References elm::Array< class >::count().
otawa::BasicBlock::~BasicBlock | ( | void | ) |
Get initial address of the block.
Referenced by otawa::Loop::address(), otawa::display::CFGDecorator::displayHeader(), otawa::cfgio::Output::processBB(), otawa::oslice::Slicer::processWorkingList(), and otawa::oslice::LivenessChecker::processWorkingList().
void otawa::BasicBlock::basicPreds | ( | basic_preds_t & | preds | ) |
Compute the predecessors of the current basic block that (a) are basic blocks and (b)for which transition can be accounted by an edge.
The result predecessor vector is empty if there is at least one predecessor basic block that cannot be accounted by an edge.
This function is useful when an analysis requires to work on instructions of chains of basic blocks.
The result is a vector of pair (b, e) where b is a predecessor basic blocks and e the edge that account for the number of iterations of the basic block.
preds | List of predecessors basic blocks and accounting edge. |
References otawa::CFG::callCount(), otawa::SynthBlock::callee(), otawa::CFG::callers(), otawa::Block::cfg(), otawa::graph::Vertex::countIns(), otawa::CFG::exit(), otawa::graph::GenVertex< V, E >::inEdges(), otawa::graph::GenVertex< Block, Edge >::inEdges(), otawa::Block::isBasic(), otawa::Block::isEntry(), otawa::Block::isPhony(), p(), elm::pair(), elm::Vector< class, class, class >::pop(), otawa::graph::GenVertex< Block, Edge >::preds(), elm::Vector< class, class, class >::push(), otawa::Block::toBasic(), and otawa::Block::toSynth().
|
inline |
References otawa::display::begin(), otawa::display::end(), and elm::subiter().
Referenced by otawa::se::FilterBuilder::getFilters().
Test if the current BB contains the given instruction.
Beware: as some instruction sets melt opcode of instructions, it is not enough to test containment with addresses. Hence, this function test really if the given instruction is member of the BB list of instructions.
i | Instruction to look for. |
Get the control instruction of the block (if any).
References otawa::IGNORE_CONTROL.
Referenced by otawa::etime::EdgeTimeBuilder::getBranchNode().
int otawa::BasicBlock::count | ( | void | ) | const |
Count the number of instructions in the block.
Get the first instruction of the block.
Referenced by otawa::clp::Manager::next(), otawa::oslice::Slicer::processWorkingList(), and otawa::oslice::LivenessChecker::processWorkingList().
Get the last instruction of the block.
Referenced by otawa::oslice::Manager::next(), and otawa::AbstractCFGBuilder::seq().
|
inline |
Test if the area of the current BB overlaps the memory area of the given BB.
bb | BB to test for overlapping. |
Test if the area of the current BB overlaps the given memory area.
area | Memory area to test with. |
References otawa::MemArea::meet().
int otawa::BasicBlock::size | ( | void | ) | const |
Get size of the basic block.
References _insts.
Referenced by otawa::cfgio::Output::processBB().
Get top address, that is, the address of the byte following the basic block.
Block | top address. |
Referenced by otawa::AbstractCFGBuilder::buildBBs().
|
private |
Referenced by size().