Otawa
0.10
|
This class represents edges in the CFG representation. More...
#include <otawa/cfg/Edge.h>
Public Types | |
enum | kind_t { NONE = 0, TAKEN = 1, NOT_TAKEN = 2, CALL = 3, VIRTUAL = 4, VIRTUAL_CALL = 5, VIRTUAL_RETURN = 6, EXN_CALL = 7, EXN_RETURN = 8 } |
Kind of the edge. More... | |
typedef enum otawa::Edge::kind_t | kind_t |
Public Member Functions | |
Edge (BasicBlock *source, BasicBlock *target, kind_t kind=TAKEN) | |
Build a new edge. More... | |
~Edge (void) | |
Delete an edge. More... | |
BasicBlock * | source (void) const |
BasicBlock * | target (void) const |
kind_t | kind (void) const |
CFG * | calledCFG (void) const |
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 Member Functions | |
static cstring | kindName (kind_t kind) |
Get the name of a kind. More... | |
Static Public Attributes | |
static const PropList | EMPTY |
This is an empty proplist for convenience. More... | |
Private Member Functions | |
void | toCall (void) |
Transform this edge as a call edge. More... | |
Private Attributes | |
kind_t | knd |
BasicBlock * | src |
BasicBlock * | tgt |
Friends | |
class | CFG |
This class represents edges in the CFG representation.
They allow hooking annotations.
typedef enum otawa::Edge::kind_t otawa::Edge::kind_t |
enum otawa::Edge::kind_t |
Kind of the edge.
Enumerator | |
---|---|
NONE |
No meaning. For syntactic use only. |
TAKEN |
Kind of an edge matching a branch instruction. |
NOT_TAKEN |
Kind of an edge matching the natural sequential control flow between a basic block and its successor. |
CALL |
Kind of an edge matching a sub-program call. Edges of this kind provides a calledCFG() value. |
VIRTUAL |
Kind of an edge linking the virtual entry and exit basic blocks with other ones of the CFG. Does not match any instruction in the sub-program. |
VIRTUAL_CALL |
Edges of this kind are only found in a virtual CFG. They replace CALL edges whose CFG has been embedded. |
VIRTUAL_RETURN |
Edges of this kind are only found in a virtual CFG. When a subprogram call is embedded in the main CFG, they link the last basic block of the called subprogram with the basic block successors of the calling basic block. |
EXN_CALL |
Edges of this kind are usually added after an analysis of the CFG to denote raise of exception (system call, error, etc). The body of the exception handler is linked with an edge of type EXN_CALL while the return is linked with an edge of type EXN_RETURN. |
EXN_RETURN |
otawa::Edge::Edge | ( | BasicBlock * | source, |
BasicBlock * | target, | ||
kind_t | kind = TAKEN |
||
) |
Build a new edge.
References otawa::BasicBlock::addInEdge(), otawa::BasicBlock::addOutEdge(), CALL, otawa::BasicBlock::cfg(), EDGE_Null, src, and tgt.
otawa::Edge::~Edge | ( | void | ) |
Delete an edge.
References CALL, knd, otawa::BasicBlock::removeInEdge(), otawa::BasicBlock::removeOutEdge(), src, and tgt.
|
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 |
|
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().
|
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 |
References knd.
Referenced by otawa::DelayedBuilder::cloneEdge(), otawa::DelayedBuilder::fix(), otawa::display::CFGOutput::genEdgeLabel(), otawa::DelayedBuilder::insert(), kindName(), otawa::ipet::VarAssignment::makeEdgeVar(), otawa::display::CFGDrawer::onEdge(), otawa::BBStatCollector::processCFG(), otawa::ContextualProcessor::processCFG(), and otawa::etime::EdgeTimeBuilder::processEdge().
Get the name of a kind.
kind | Kind to get name of. |
References kind().
Referenced by otawa::cfgio::Output::processBB(), and otawa::CFGSaver::processBB().
|
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().
|
inline |
References src.
Referenced by otawa::ContextualProcessor::avoidingRecursive(), otawa::ContextualProcessor::enteringCall(), otawa::DelayedBuilder::fix(), otawa::PSTBuilder::getVCFG(), otawa::DelayedBuilder::insert(), otawa::dfa::hai::HalfAbsInt< FixPoint >::isEdgeDone(), otawa::ipet::VarAssignment::makeEdgeVar(), otawa::dfa::hai::HalfAbsInt< FixPoint >::outputProcessing(), otawa::SESERegion::print(), otawa::BBStatCollector::processCFG(), otawa::ContextualProcessor::processCFG(), otawa::etime::EdgeTimeBuilder::processEdge(), otawa::BackwardCFGAdapter::sinkOf(), otawa::display::CFGAdapter::Edge::source(), otawa::ForwardCFGAdapter::sourceOf(), and otawa::ai::CFGGraph::sourceOf().
|
inline |
References tgt.
Referenced by otawa::etime::EdgeTimeBuilder::applyWeightedSplit(), otawa::ContextualProcessor::avoidingRecursive(), otawa::DelayedBuilder::cloneEdge(), otawa::ContextualProcessor::enteringCall(), otawa::PSTBuilder::getVCFG(), otawa::DelayedBuilder::insert(), otawa::Dominance::isBackEdge(), otawa::dfa::hai::HalfAbsInt< FixPoint >::isEdgeDone(), otawa::ContextualProcessor::leavingCall(), otawa::ipet::VarAssignment::makeEdgeVar(), otawa::SESERegion::print(), otawa::BBStatCollector::processCFG(), otawa::ContextualProcessor::processCFG(), otawa::etime::EdgeTimeBuilder::processEdge(), otawa::display::CFGAdapter::Edge::sink(), otawa::ForwardCFGAdapter::sinkOf(), otawa::ai::CFGGraph::sinkOf(), and otawa::BackwardCFGAdapter::sourceOf().
|
private |
Transform this edge as a call edge.
References CALL, otawa::BasicBlock::FLAG_Call, otawa::BasicBlock::flags, knd, otawa::BasicBlock::removeInEdge(), src, and tgt.
Referenced by otawa::CFG::scan().
|
friend |
|
staticinherited |
This is an empty proplist for convenience.
|
private |
Referenced by calledCFG(), kind(), toCall(), and ~Edge().
|
private |
|
private |
Referenced by calledCFG(), Edge(), target(), toCall(), and ~Edge().