Otawa
0.10
|
#include <otawa/util/ContextTree.h>
Classes | |
class | BBIterator |
class | ChildrenIterator |
Iterator for the children of a context tree. More... | |
Public Types | |
enum | kind_t { ROOT = 0, FUNCTION, LOOP } |
This enumerate represents the kind of a context tree. More... | |
typedef enum otawa::ContextTree::kind_t | kind_t |
Public Member Functions | |
ContextTree (CFG *cfg, ContextTree *parent=0, bool _inline=true) | |
Build a new context tree for the given CFG. More... | |
~ContextTree (void) | |
Free the entire tree. More... | |
BasicBlock * | bb (void) const |
Get the BB that heads this tree (enter of functions for ROOT and FUNCTION, header for LOOP). More... | |
kind_t | kind (void) const |
Get the kind of the tree node. More... | |
CFG * | cfg (void) const |
Get the CFG containing this context tree. More... | |
ContextTree * | parent (void) const |
Get the parent tree of the current one. More... | |
bool | isChildOf (const ContextTree *ct) |
Test transitively if the current context tree is a child of the given one. More... | |
ContextTree * | enclosingFunction (void) |
Find the enclosing function containing this context tree. More... | |
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 const PropList | EMPTY |
This is an empty proplist for convenience. More... | |
Private Member Functions | |
ContextTree (BasicBlock *bb, CFG *cfg, ContextTree *parent) | |
Build the context tree of a loop. More... | |
void | addChild (ContextTree *tree) |
Add a children context tree. More... | |
void | addBB (BasicBlock *bb, bool _inline) |
Add the given basic block to the context tree. More... | |
Private Attributes | |
kind_t | _kind |
BasicBlock * | _bb |
CFG * | _cfg |
elm::genstruct::Vector < BasicBlock * > | _bbs |
elm::genstruct::Vector < ContextTree * > | _children |
ContextTree * | _parent |
typedef enum otawa::ContextTree::kind_t otawa::ContextTree::kind_t |
|
private |
Build the context tree of a loop.
bb | Header of the loop. |
cfg | Owner CFG. |
parent | Parent context tree. |
Referenced by addBB(), and ContextTree().
otawa::ContextTree::ContextTree | ( | CFG * | cfg, |
ContextTree * | parent = 0 , |
||
bool | _inline = true |
||
) |
Build a new context tree for the given CFG.
cfg | CFG to build the context tree for. |
parent | Parent context tree. |
_inline | If true, inline the call BB. |
References addBB(), addChild(), bb(), ContextTree(), otawa::ENCLOSING_LOOP_HEADER, otawa::CFG::label(), otawa::LOOP_HEADER, otawa::OWNER_CONTEXT_TREE, parent(), and TRACE.
otawa::ContextTree::~ContextTree | ( | void | ) |
Free the entire tree.
References _children.
|
private |
Add the given basic block to the context tree.
bb | Added BB. |
bb | If true, inline the call. |
References _bbs, addChild(), otawa::Edge::CALL, ContextTree(), otawa::cfgio::edge(), enclosingFunction(), otawa::BasicBlock::isCall(), LOOP, parent(), and TRACE.
Referenced by ContextTree().
|
private |
|
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 BB that heads this tree (enter of functions for ROOT and FUNCTION, header for LOOP).
References _bb.
Referenced by otawa::ccg::ConstraintBuilder::addConstraintHeader(), otawa::cat::CATConstraintBuilder::buildLBLOCKSET(), ContextTree(), and otawa::cat::CATBuilder::worst().
|
inline |
Get the CFG containing this context tree.
References _cfg.
Referenced by addChild().
|
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().
ContextTree * otawa::ContextTree::enclosingFunction | ( | void | ) |
|
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().
|
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 |
Test transitively if the current context tree is a child of the given one.
ct | Parent context tree. |
References _parent.
|
inline |
Get the kind of the tree node.
References _kind.
Referenced by addChild(), otawa::ccg::ConstraintBuilder::addConstraintHeader(), otawa::cat::CATBuilder::buildLBLOCKSET(), otawa::cat::CATConstraintBuilder::buildLBLOCKSET(), enclosingFunction(), otawa::cat::CATBuilder::setCATEGORISATION(), and otawa::cat::CATBuilder::worst().
|
inline |
Get the parent tree of the current one.
References _parent.
Referenced by addBB(), ContextTree(), and enclosingFunction().
|
inherited |
Display the current property list.
out | Output to use. |
Referenced by otawa::operator<<(), and otawa::ContextualProperty::print().
|
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().
|
private |
Referenced by bb().
|
private |
Referenced by addBB().
|
private |
Referenced by addChild(), and cfg().
|
private |
Referenced by addChild(), and ~ContextTree().
|
private |
Referenced by addChild(), and kind().
|
private |
Referenced by isChildOf(), and parent().
|
staticinherited |
This is an empty proplist for convenience.