OTAWA  2.0
Framework to perform machine analysis and compute WCET.
otawa::Block Class Reference

#include <otawa/cfg/CFG.h>

+ Inheritance diagram for otawa::Block:

Public Member Functions

Address address (void) const
 
CFGcfg (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)
 
BasicBlocktoBasic (void)
 
const BasicBlocktoBasic (void) const
 
SynthBlocktoSynth (void)
 
const SynthBlocktoSynth (void) const
 
- Public Member Functions inherited from otawa::PropList
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...
 
PropertyextractProp (const AbstractIdentifier &id)
 
PropertyextractProp (const AbstractIdentifier *id)
 Remove a property matching the given identifier and return it. More...
 
PropertygetProp (const AbstractIdentifier *id) const
 Find a property by its identifier. More...
 
bool hasProp (const AbstractIdentifier &id) const
 
PropListoperator= (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)
 
- Public Member Functions inherited from otawa::graph::GenVertex< Block, Edge >
EdgeCollection inEdges (void) const
 
EdgeIter ins (void) const
 
EdgeCollection outEdges (void) const
 
EdgeIter outs (void) const
 
PredCollection preds (void) const
 
SuccCollection succs (void) const
 
- Public Member Functions inherited from otawa::graph::Vertex
int countIns (void) const
 
int countOuts (void) const
 
int index (void) const
 
const edges_tinEdges (void) const
 
EdgeIter ins (void) const
 
const edges_toutEdges (void) const
 
EdgeIter outs (void) const
 
 Vertex (void)
 

Static Public Attributes

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 Public Attributes inherited from otawa::PropList
static rtti::Type__type = prop_list_class
 
static const PropList EMPTY
 This is an empty proplist for convenience. More...
 

Protected Member Functions

 Block (t::uint16 type=IS_BASIC)
 Build a CFG block. More...
 
- Protected Member Functions inherited from otawa::graph::Vertex
 ~Vertex (void)
 

Private Attributes

CFG_cfg
 
t::uint16 _type
 
EdgeIter ntak
 

Friends

class CFG
 
class CFGMaker
 

Additional Inherited Members

- Public Types inherited from otawa::graph::Vertex
typedef edges_t::Iter EdgeIter
 
typedef elm::List< Edge * > edges_t
 

Detailed Description

A node in the CFG. This class is abstract and usually subclassed as BasicBlock or SynthBlock.

Constructor & Destructor Documentation

◆ Block()

otawa::Block::Block ( t::uint16  type = IS_BASIC)
protected

Build a CFG block.

Parameters
typeBlock type.

Member Function Documentation

◆ address()

◆ cfg()

◆ id()

int otawa::Block::id ( void  ) const
inline

Returns a Block identifier that is unique to the whole program

Returns a Block identifier that is unique to the whole program. This number if positive or null and less than the countBB() of the CFG collection containing the parent CFG of this block.

Returns
Unique identifier.

Referenced by otawa::ai::CFGAnalyzer::after(), otawa::ai::CFGAnalyzer::before(), otawa::ai::CFGAnalyzer::doTrace(), otawa::ai::DefaultBlockStore< typename D::t >::get(), otawa::ai::BlockAnalysis< D, S >::get(), otawa::ai::CFGCollectionGraph::index(), otawa::CompositeCFG::index(), otawa::ai::SimpleWorkList::put(), otawa::ai::Queue::put(), otawa::ai::BlockAnalysis< D, S >::put(), and otawa::ai::DefaultBlockStore< typename D::t >::set().

◆ isBasic()

◆ isCall()

bool otawa::Block::isCall ( void  ) const
inline

Test if a synthetic block is subprogram call.

Returns
True if block is a synthetic subprogram call.

Referenced by otawa::CompositeCFG::isCall(), and otawa::CompositeCFG::isReturn().

◆ isEnd()

◆ isEntry()

◆ isExit()

◆ isPhony()

bool otawa::Block::isPhony ( void  ) const
inline

◆ isSynth()

◆ isUnknown()

otawa::Block::isUnknown ( void  ) const
inline

◆ isVirtual()

bool otawa::Block::isVirtual ( void  ) const
inline

Test if the block is an end, i.e. an entry, exit or unknown block.

Returns
True if block is an end.

Referenced by otawa::operator<<().

◆ operator BasicBlock *()

otawa::Block::operator BasicBlock * ( void  )
inline

Convert current block to BasicBlock. An assertion failure is raised if it can't be.

Returns
Matching basic block.

◆ operator SynthBlock *()

otawa::Block::operator SynthBlock * ( void  )
inline

Convert current block to SynthBlock. An assertion failure is raised if it can't be.

Returns
Matching synthetic block.

◆ toBasic() [1/2]

BasicBlock * otawa::Block::toBasic ( void  )
inline

◆ toBasic() [2/2]

◆ toSynth() [1/2]

SynthBlock * otawa::Block::toSynth ( void  )
inline

◆ toSynth() [2/2]

Friends And Related Function Documentation

◆ CFG

friend class CFG
friend

◆ CFGMaker

friend class CFGMaker
friend

Member Data Documentation

◆ _cfg

CFG* otawa::Block::_cfg
private

◆ _type

t::uint16 otawa::Block::_type
private

◆ IS_BASIC

const t::uint16 otawa::Block::IS_BASIC = 1 << 0
static

◆ IS_CALL

const t::uint16 otawa::Block::IS_CALL = 0x2 << 0
static

◆ IS_ENTRY

const t::uint16 otawa::Block::IS_ENTRY = 0 << 2
static

◆ IS_EXIT

const t::uint16 otawa::Block::IS_EXIT = 1 << 2
static

Referenced by otawa::CFGMaker::exit().

◆ IS_PHONY

const t::uint16 otawa::Block::IS_PHONY = 3 << 2
static

◆ IS_SYNTH

const t::uint16 otawa::Block::IS_SYNTH = 2 << 0
static

◆ IS_UNKN

const t::uint16 otawa::Block::IS_UNKN = 2 << 2
static

◆ IS_VIRTUAL

const t::uint16 otawa::Block::IS_VIRTUAL = 0 << 0
static

◆ MASK1

const t::uint16 otawa::Block::MASK1 = 0x3
static

◆ MASK12

const t::uint16 otawa::Block::MASK12 = MASK1 | (0x3 << 2)
static

◆ ntak

EdgeIter otawa::Block::ntak
private

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