Otawa  0.10
otawa::Edge Class Reference

This class represents edges in the CFG representation. More...

#include <otawa/cfg/Edge.h>

Inheritance diagram for otawa::Edge:
otawa::PropList

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...
 
BasicBlocksource (void) const
 
BasicBlocktarget (void) const
 
kind_t kind (void) const
 
CFGcalledCFG (void) const
 
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 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
 
BasicBlocksrc
 
BasicBlocktgt
 

Friends

class CFG
 

Detailed Description

This class represents edges in the CFG representation.

They allow hooking annotations.

Member Typedef Documentation

Member Enumeration Documentation

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 

Constructor & Destructor Documentation

otawa::Edge::Edge ( BasicBlock source,
BasicBlock target,
kind_t  kind = TAKEN 
)
otawa::Edge::~Edge ( void  )

Member Function Documentation

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().

cstring otawa::Edge::kindName ( kind_t  kind)
static

Get the name of a kind.

Parameters
kindKind to get name of.
Returns
Kind name.

References kind().

Referenced by otawa::cfgio::Output::processBB(), and otawa::CFGSaver::processBB().

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
void otawa::Edge::toCall ( void  )
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().

Friends And Related Function Documentation

friend class CFG
friend

Member Data Documentation

const PropList otawa::PropList::EMPTY
staticinherited

This is an empty proplist for convenience.

kind_t otawa::Edge::knd
private

Referenced by calledCFG(), kind(), toCall(), and ~Edge().

BasicBlock* otawa::Edge::src
private

Referenced by Edge(), source(), toCall(), and ~Edge().

BasicBlock * otawa::Edge::tgt
private

Referenced by calledCFG(), Edge(), target(), toCall(), and ~Edge().


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