Otawa  0.10
otawa::ProgItem Class Referenceabstract

Base class of the components of a program file segment. More...

#include <otawa/prog/ProgItem.h>

Inheritance diagram for otawa::ProgItem:
otawa::PropList elm::inhstruct::DLNode otawa::Inst otawa::loader::new_gliss::Inst otawa::loader::old_gliss::Inst otawa::loader::new_gliss::BranchInst otawa::loader::old_gliss::BranchInst

Public Member Functions

ProgItemnext (void) const
 Get the next program item. More...
 
ProgItemprevious (void) const
 Get the previous program item. More...
 
virtual address_t address (void) const =0
 Get the address of the item . More...
 
virtual t::uint32 size (void) const =0
 Get the size of the item in bytes. More...
 
address_t topAddress (void) const
 Compute the address of the item immediately following the current item. More...
 
virtual InsttoInst (void)
 Return the instruction matching the current item. More...
 
PropertygetProp (const AbstractIdentifier *id) const
 Find a property by its identifier. More...
 
void setProp (Property *prop)
 Set the property in the property list removing any double. More...
 
void setProp (const AbstractIdentifier *id)
 
void removeProp (const AbstractIdentifier *id)
 Remove a property matching the given identifier. More...
 
void removeProp (const AbstractIdentifier &id)
 
PropertyextractProp (const AbstractIdentifier *id)
 Remove a property matching the given identifier and return it. More...
 
PropertyextractProp (const AbstractIdentifier &id)
 Remove a property matching the given identifier and return it. More...
 
void addProp (Property *prop)
 Add property to the list without checking of duplication. More...
 
void removeAllProp (const AbstractIdentifier *id)
 Remove all the properties matching the given identifier. More...
 
bool hasProp (const AbstractIdentifier &id) const
 Test if the property list contains a property matching the given identifier. More...
 
void clearProps (void)
 Remove all properties from the list. More...
 
void addProps (const PropList &props)
 Add all properties from the given property list, in a reverse order. More...
 
void print (elm::io::Output &out) const
 Display the current property list. More...
 

Static Public Attributes

static const PropList EMPTY
 This is an empty proplist for convenience. More...
 

Protected Member Functions

virtual ~ProgItem (void)
 Protected destructor for avoiding implementation unexpected deletion. More...
 
void insertPseudo (ProgItem *pos)
 
bool atBegin (void) const
 
bool atEnd (void) const
 
void replace (DLNode *node)
 
void insertAfter (DLNode *node)
 
void insertBefore (DLNode *node)
 
void remove (void)
 
void removeNext (void)
 
void removePrevious (void)
 

Friends

class Segment
 

Detailed Description

Base class of the components of a program file segment.

Constructor & Destructor Documentation

otawa::ProgItem::~ProgItem ( void  )
protectedvirtual

Protected destructor for avoiding implementation unexpected deletion.

Member Function Documentation

address_t otawa::ProgItem::address ( void  ) const
pure virtual

Get the address of the item .

Returns
Address of the item or address 0 if none is assigned.
Note
In workstation systems, it is commonly accepted that the address 0 is ever invalid because it is the usual value of NULL in C. It should also work the same for embedded systems.

Implemented in otawa::loader::new_gliss::Inst, and otawa::loader::old_gliss::Inst.

Referenced by otawa::ParExeGraph::addEdgesForFetch(), otawa::PFGBuilder::addFunction(), otawa::LBlockBuilder::addLBlock(), otawa::ccg::LBlockBuilder::addLBlock(), otawa::LBlock::address(), otawa::ccg::LBlock::address(), otawa::BasicBlock::Bundle::address(), otawa::BasicBlock::address(), otawa::ets::ACSComputation::applyProcess(), otawa::CFGBuilder::buildCFG(), otawa::ets::WCETComputation::computation(), otawa::ast::BlockAST::countInstructions(), otawa::LBlock::countInsts(), otawa::ccg::LBlock::countInsts(), otawa::ipet::FlowFactLoader::enteringCall(), otawa::Virtualizer::enteringCall(), otawa::CFGInfo::findCFG(), otawa::Segment::findItemAt(), otawa::WorkSpace::format(), otawa::se::getFilterForAddr(), otawa::se::getFilterForReg(), otawa::VarTextDecoder::getInst(), otawa::ets::ACSComputation::initialization(), otawa::Segment::insert(), otawa::ipet::FlowFactLoader::lookLineAt(), otawa::ast::ASTLoader::makeBlock(), otawa::se::FilterBuilder::makeFilters(), otawa::DelayedBuilder::makeNOp(), otawa::LBlockManager::next(), otawa::DelayedBuilder::next(), otawa::FlowFactLoader::onLoop(), otawa::AccessedAddress::print(), otawa::dcache::BlockAccess::print(), otawa::ets::FlowFactLoader::processAST(), otawa::CFGChecker::processBB(), otawa::branch::OnlyConsBuilder::processBB(), otawa::branch::CondNumber::processBB(), otawa::LBlockBuilder::processBB(), otawa::ccg::LBlockBuilder::processBB(), otawa::dcache::CLPBlockBuilder::processBB(), otawa::etime::StandardEventBuilder::processBB(), otawa::dcache::BlockBuilder::processBB(), otawa::BBStatCollector::processCFG(), otawa::VarTextDecoder::processEntry(), otawa::VarTextDecoder::processWorkSpace(), otawa::CFGBuilder::processWorkSpace(), otawa::dcache::CatConstraintBuilder::processWorkSpace(), otawa::FlowFactLoader::scanIgnoreControl(), otawa::FlowFactLoader::scanIgnoreSeq(), otawa::FlowFactLoader::scanMultiBranch(), otawa::FlowFactLoader::scanMultiCall(), otawa::FlowFactLoader::scanNoInline(), otawa::FlowFactLoader::scanSetInlining(), otawa::DelayedBuilder::size(), otawa::CFGProcessor::str(), topAddress(), and otawa::BranchProblem::update().

void otawa::PropList::clearProps ( void  )
inherited
Property * otawa::PropList::extractProp ( const AbstractIdentifier id)
inherited

Remove a property matching the given identifier and return it.

Caller is responsible of the management of the obtained property.

Parameters
idIdentifier of the property to extract.

References otawa::Property::_next, and otawa::Property::next().

Referenced by otawa::script::Script::makeConfig().

Property * otawa::PropList::extractProp ( const AbstractIdentifier id)
inlineinherited

Remove a property matching the given identifier and return it.

Caller is responsible of the management of the obtained property.

Parameters
idIdentifier of the property to extract.

References otawa::PropList::extractProp().

Referenced by otawa::PropList::extractProp().

bool otawa::PropList::hasProp ( const AbstractIdentifier id) const
inlineinherited

Test if the property list contains a property matching the given identifier.

Parameters
idProperty identifier to look for.
Returns
True if the list contains the matching property, false else.

References otawa::PropList::getProp().

Referenced by otawa::ipet::BasicConstraintsBuilder::addEntryConstraint(), otawa::Monitor::configure(), otawa::ImmutableRef< T, I >::exists(), and otawa::Manager::setVerbosity().

void otawa::ProgItem::insertPseudo ( ProgItem pos)
inlineprotected
ProgItem * otawa::ProgItem::next ( void  ) const

Get the next program item.

Returns
Next program item, null at the end of the list.

References elm::inhstruct::DLNode::atEnd().

Referenced by otawa::Segment::findItemAt(), otawa::Segment::insert(), and otawa::Inst::nextInst().

ProgItem * otawa::ProgItem::previous ( void  ) const

Get the previous program item.

Returns
Previous program item, null at the begin of the list.

References elm::inhstruct::DLNode::atBegin().

Referenced by otawa::Segment::insert(), and otawa::Inst::prevInst().

void otawa::PropList::print ( elm::io::Output out) const
inherited

Display the current property list.

Parameters
outOutput to use.

Referenced by otawa::operator<<(), and otawa::ContextualProperty::print().

void otawa::PropList::removeAllProp ( const AbstractIdentifier id)
inherited

Remove all the properties matching the given identifier.

Parameters
idIdentifier of properties to remove.

References otawa::Property::_next, and otawa::Property::next().

Referenced by otawa::LoopUnroller::unroll().

void otawa::PropList::removeProp ( const AbstractIdentifier id)
inherited
void otawa::PropList::removeProp ( const AbstractIdentifier id)
inlineinherited
void otawa::PropList::setProp ( Property prop)
inherited

Set the property in the property list removing any double.

Parameters
propProperty to set.

References otawa::Property::_next, otawa::Property::id(), and otawa::Property::next().

void otawa::PropList::setProp ( const AbstractIdentifier id)
inlineinherited
size_t otawa::ProgItem::size ( void  ) const
pure virtual

Get the size of the item in bytes.

Returns
Size of the item.

Referenced by otawa::Segment::insert(), otawa::DelayedBuilder::makeNOp(), otawa::DelayedBuilder::size(), and topAddress().

Inst * otawa::ProgItem::toInst ( void  )
virtual

Return the instruction matching the current item.

Returns
Matching instruction or null if the current program item is not an instruction.

Reimplemented in otawa::Inst.

Referenced by otawa::Segment::findInstAt(), otawa::Inst::nextInst(), otawa::Inst::prevInst(), and otawa::TextDecoder::processWorkSpace().

Friends And Related Function Documentation

friend class Segment
friend

Member Data Documentation

const PropList otawa::PropList::EMPTY
staticinherited

This is an empty proplist for convenience.


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