Otawa
0.10
|
Representation of C language FOR loop. More...
#include <otawa/ast/ForAST.h>
Public Member Functions | |
ForAST (AST *initialization, AST *condition, AST *incrementation, AST *body) | |
Build a new FOR AST. More... | |
AST * | initialization (void) const |
Get the initialization AST. More... | |
AST * | condition (void) const |
Get the condition AST. More... | |
AST * | incrementation (void) const |
Get the incrementation AST. More... | |
AST * | body (void) const |
Get the body AST. More... | |
virtual Inst * | first (void) |
virtual ast_kind_t | kind (void) const |
Get the kind of the AST. More... | |
virtual ForAST * | toFor (void) |
Get the repetition AST if this AST is a repetition, null else. More... | |
virtual int | countInstructions (void) const |
Count the number of instructions in the ast block. More... | |
virtual void | release (void) |
Deletion of AST can only be performed using this method. More... | |
virtual bool | isNOP (void) |
Test if the AST is the NOP AST. More... | |
virtual bool | isUndef (void) |
Test if the AST is the undefined AST. More... | |
virtual BlockAST * | toBlock (void) |
Get the block AST if this AST is a block, null else. More... | |
virtual CallAST * | toCall (void) |
Get the call AST if this AST is a call, null else. More... | |
virtual SeqAST * | toSeq (void) |
Get the sequence AST if this AST is a sequence, null else. More... | |
virtual IfAST * | toIf (void) |
Get the selection AST if this AST is a selection, null else. More... | |
virtual WhileAST * | toWhile (void) |
Get the repetition AST if this AST is a repeatition, null else. More... | |
virtual DoWhileAST * | toDoWhile (void) |
Get the repetition AST if this AST is a repetition, null else. More... | |
void | lock (void) |
void | unlock () |
Property * | getProp (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) |
Property * | extractProp (const AbstractIdentifier *id) |
Remove a property matching the given identifier and return it. More... | |
Property * | extractProp (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 AST & | NOP = nop_inst |
Unique instance of the NOP AST. More... | |
static AST & | UNDEF = undef_inst |
Unique instance of the Undef AST. More... | |
static const PropList | EMPTY |
This is an empty proplist for convenience. More... | |
Protected Member Functions | |
virtual | ~ForAST (void) |
Private Attributes | |
AST * | bod |
AST * | cnd |
AST * | init |
AST * | inc |
Representation of C language FOR loop.
|
protectedvirtual |
References bod, cnd, inc, init, and otawa::ast::AST::release().
otawa::ast::ForAST::ForAST | ( | AST * | initialization, |
AST * | condition, | ||
AST * | incrementation, | ||
AST * | body | ||
) |
Build a new FOR AST.
|
inherited |
Add property to the list without checking of duplication.
prop | Property to add. |
References otawa::Property::_next.
Referenced by otawa::Identifier< T >::add(), otawa::ast::ASTInfo::ASTInfo(), otawa::Identifier< otawa::arm::Info * >::copy(), otawa::AbstractIdentifier::initProps(), otawa::ContextualProperty::make(), otawa::script::Script::makeConfig(), otawa::ccg::Builder::processLBlockSet(), otawa::ipet::ILPSystemGetter::processWorkSpace(), otawa::Identifier< T >::ref(), otawa::ContextualProperty::ref(), and otawa::ContextualProperty::refProps().
|
inherited |
Add all properties from the given property list, in a reverse order.
props | Property list to clone. |
References copy(), otawa::PropList::head, and otawa::Property::next().
Referenced by otawa::display::CFGDrawer::CFGDrawer(), otawa::display::GraphVizGraph::GraphVizGraph(), otawa::ParamFeature::instantiate(), otawa::Manager::loadXML(), otawa::display::GraphVizGraph::newEdge(), otawa::display::GraphVizGraph::newNode(), otawa::PropList::operator=(), otawa::Process::Process(), otawa::PropList::PropList(), otawa::display::GraphVizItem::setProps(), otawa::VirtualBasicBlock::VirtualBasicBlock(), and otawa::VirtualCFG::VirtualCFG().
|
inline |
Get the body AST.
References bod.
Referenced by otawa::ets::ACSComputation::applyProcess(), otawa::ets::CacheHitComputation::computation(), otawa::ets::CacheMissComputation::computation(), otawa::ets::CacheFirstMissComputation::computation(), otawa::ets::WCETComputation::computation(), otawa::ets::ACSComputation::initialization(), otawa::ets::FlowFactLoader::processAST(), and otawa::ets::TrivialAstBlockTime::processAST().
|
inherited |
Remove all properties from the list.
References otawa::Property::next().
Referenced by otawa::PSTBuilder::getVCFG(), otawa::PropList::operator=(), otawa::display::GraphVizItem::setProps(), otawa::PropList::~PropList(), and otawa::WorkSpace::~WorkSpace().
|
inline |
Get the condition AST.
References cnd.
Referenced by otawa::ets::ACSComputation::applyProcess(), otawa::ets::CacheHitComputation::computation(), otawa::ets::CacheMissComputation::computation(), otawa::ets::CacheFirstMissComputation::computation(), otawa::ets::WCETComputation::computation(), otawa::ets::ACSComputation::initialization(), otawa::ets::FlowFactLoader::processAST(), and otawa::ets::TrivialAstBlockTime::processAST().
|
virtual |
Count the number of instructions in the ast block.
Implements otawa::ast::AST.
References bod, cnd, otawa::ast::AST::countInstructions(), inc, and init.
|
inherited |
Remove a property matching the given identifier and return it.
Caller is responsible of the management of the obtained property.
id | Identifier of the property to extract. |
References otawa::Property::_next, and otawa::Property::next().
Referenced by otawa::script::Script::makeConfig().
|
inlineinherited |
Remove a property matching the given identifier and return it.
Caller is responsible of the management of the obtained property.
id | Identifier of the property to extract. |
References otawa::PropList::extractProp().
Referenced by otawa::PropList::extractProp().
|
virtual |
Implements otawa::ast::AST.
References cnd, otawa::ast::AST::first(), and init.
|
inherited |
Find a property by its identifier.
id | Identifier of the property to find. |
References otawa::Property::_next, and otawa::Property::next().
Referenced by otawa::Identifier< otawa::arm::Info * >::exists(), otawa::ContextualProperty::exists(), otawa::ContextualProperty::find(), otawa::Identifier< T >::get(), otawa::PropList::hasProp(), otawa::ContextualProperty::make(), otawa::ParamFeature::matches(), otawa::ImmutableRef< T, I >::print(), otawa::ContextualProperty::print(), otawa::Identifier< T >::ref(), otawa::ContextualProperty::ref(), otawa::ContextualProperty::refProps(), otawa::Identifier< T >::set(), otawa::Identifier< T >::use(), and otawa::Identifier< T >::value().
|
inlineinherited |
Test if the property list contains a property matching the given identifier.
id | Property identifier to look for. |
References otawa::PropList::getProp().
Referenced by otawa::ipet::BasicConstraintsBuilder::addEntryConstraint(), otawa::Monitor::configure(), otawa::ImmutableRef< T, I >::exists(), and otawa::Manager::setVerbosity().
|
inline |
Get the incrementation AST.
References inc.
Referenced by otawa::ets::ACSComputation::applyProcess(), otawa::ets::CacheHitComputation::computation(), otawa::ets::CacheMissComputation::computation(), otawa::ets::CacheFirstMissComputation::computation(), otawa::ets::WCETComputation::computation(), otawa::ets::ACSComputation::initialization(), otawa::ets::FlowFactLoader::processAST(), and otawa::ets::TrivialAstBlockTime::processAST().
|
inline |
Get the initialization AST.
References init.
Referenced by otawa::ets::ACSComputation::applyProcess(), otawa::ets::CacheHitComputation::computation(), otawa::ets::CacheMissComputation::computation(), otawa::ets::CacheFirstMissComputation::computation(), otawa::ets::WCETComputation::computation(), otawa::ets::ACSComputation::initialization(), otawa::ets::FlowFactLoader::processAST(), and otawa::ets::TrivialAstBlockTime::processAST().
|
inlinevirtualinherited |
|
inlinevirtualinherited |
|
inlinevirtual |
|
inherited |
Display the current property list.
out | Output to use. |
Referenced by otawa::operator<<(), and otawa::ContextualProperty::print().
|
virtualinherited |
Deletion of AST can only be performed using this method.
Referenced by otawa::ast::DoWhileAST::~DoWhileAST(), ~ForAST(), otawa::ast::IfAST::~IfAST(), otawa::ast::SeqAST::~SeqAST(), and otawa::ast::WhileAST::~WhileAST().
|
inherited |
Remove all the properties matching the given identifier.
id | Identifier of properties to remove. |
References otawa::Property::_next, and otawa::Property::next().
Referenced by otawa::LoopUnroller::unroll().
|
inherited |
Remove a property matching the given identifier.
id | Identifier of the property to remove. |
References otawa::Property::_next, and otawa::Property::next().
Referenced by otawa::PSTBuilder::buildTree(), otawa::BBRemover< T >::clean(), otawa::display::CFGOutput::processCFG(), otawa::SubCFGBuilder::processWorkSpace(), otawa::Ref< T, I >::remove(), and otawa::ContextualPath::Ref< T >::remove().
|
inlineinherited |
References otawa::PropList::removeProp().
Referenced by otawa::PropList::removeProp().
|
inherited |
Set the property in the property list removing any double.
prop | Property to set. |
References otawa::Property::_next, otawa::Property::id(), and otawa::Property::next().
|
inlineinherited |
References otawa::PropList::setProp().
Referenced by otawa::PropList::setProp().
|
inlinevirtualinherited |
Get the block AST if this AST is a block, null else.
Reimplemented in otawa::ast::BlockAST.
Referenced by otawa::ets::ACSComputation::applyProcess(), otawa::ets::CacheHitComputation::computation(), otawa::ets::CacheMissComputation::computation(), otawa::ets::CacheFirstMissComputation::computation(), otawa::ets::WCETComputation::computation(), otawa::ets::ACSComputation::initialization(), and otawa::ets::TrivialAstBlockTime::processAST().
|
inlinevirtualinherited |
Get the call AST if this AST is a call, null else.
Reimplemented in otawa::ast::CallAST.
Referenced by otawa::ets::ACSComputation::applyProcess(), otawa::ets::CacheHitComputation::computation(), otawa::ets::CacheFirstMissComputation::computation(), otawa::ets::CacheMissComputation::computation(), otawa::ets::WCETComputation::computation(), otawa::ets::ACSComputation::initialization(), otawa::ets::FlowFactLoader::processAST(), and otawa::ets::TrivialAstBlockTime::processAST().
|
inlinevirtualinherited |
Get the repetition AST if this AST is a repetition, null else.
Reimplemented in otawa::ast::DoWhileAST.
Referenced by otawa::ets::ACSComputation::applyProcess(), otawa::ets::CacheHitComputation::computation(), otawa::ets::CacheFirstMissComputation::computation(), otawa::ets::CacheMissComputation::computation(), otawa::ets::WCETComputation::computation(), otawa::ets::ACSComputation::initialization(), otawa::ets::FlowFactLoader::processAST(), and otawa::ets::TrivialAstBlockTime::processAST().
|
inlinevirtual |
Get the repetition AST if this AST is a repetition, null else.
Reimplemented from otawa::ast::AST.
|
inlinevirtualinherited |
Get the selection AST if this AST is a selection, null else.
Reimplemented in otawa::ast::IfAST.
Referenced by otawa::ets::ACSComputation::applyProcess(), otawa::ets::CacheHitComputation::computation(), otawa::ets::CacheMissComputation::computation(), otawa::ets::CacheFirstMissComputation::computation(), otawa::ets::WCETComputation::computation(), otawa::ets::ACSComputation::initialization(), otawa::ets::FlowFactLoader::processAST(), and otawa::ets::TrivialAstBlockTime::processAST().
|
inlinevirtualinherited |
Get the sequence AST if this AST is a sequence, null else.
Reimplemented in otawa::ast::SeqAST.
Referenced by otawa::ets::ACSComputation::applyProcess(), otawa::ets::CacheHitComputation::computation(), otawa::ets::CacheMissComputation::computation(), otawa::ets::CacheFirstMissComputation::computation(), otawa::ets::WCETComputation::computation(), otawa::ets::ACSComputation::initialization(), otawa::ets::FlowFactLoader::processAST(), and otawa::ets::TrivialAstBlockTime::processAST().
|
inlinevirtualinherited |
Get the repetition AST if this AST is a repeatition, null else.
Reimplemented in otawa::ast::WhileAST.
Referenced by otawa::ets::ACSComputation::applyProcess(), otawa::ets::CacheHitComputation::computation(), otawa::ets::CacheMissComputation::computation(), otawa::ets::CacheFirstMissComputation::computation(), otawa::ets::WCETComputation::computation(), otawa::ets::ACSComputation::initialization(), otawa::ets::FlowFactLoader::processAST(), and otawa::ets::TrivialAstBlockTime::processAST().
|
private |
Referenced by body(), countInstructions(), and ~ForAST().
|
private |
Referenced by condition(), countInstructions(), first(), and ~ForAST().
|
staticinherited |
This is an empty proplist for convenience.
|
private |
Referenced by countInstructions(), incrementation(), and ~ForAST().
|
private |
Referenced by countInstructions(), first(), initialization(), and ~ForAST().