Otawa  0.10
otawa::ast::CallAST Class Reference

This class is a specialized block AST ended by a function call. More...

#include <otawa/ast/CallAST.h>

Inheritance diagram for otawa::ast::CallAST:
otawa::ast::BlockAST otawa::ast::AST elm::Lock otawa::PropList

Public Member Functions

 CallAST (Inst *block, ot::size size, FunAST *fun)
 Build a new AST call calling the given function. More...
 
 CallAST (WorkSpace *ws, Inst *block, ot::size size, Inst *called)
 Build a call AST with only the first instruction of the called function. More...
 
FunASTfunction (void) const
 Get the AST function called by this AST. More...
 
virtual ast_kind_t kind (void) const
 Get the kind of the AST. More...
 
virtual CallASTtoCall (void)
 Get the call AST if this AST is a call, null else. More...
 
Instblock (void) const
 Get the entry basic block of the AST block. More...
 
t::uint32 size (void) const
 
virtual Instfirst (void)
 Get the first instruction of the block. More...
 
virtual BlockASTtoBlock (void)
 Get the block AST if this AST is a block, 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 SeqASTtoSeq (void)
 Get the sequence AST if this AST is a sequence, null else. More...
 
virtual IfASTtoIf (void)
 Get the selection AST if this AST is a selection, null else. More...
 
virtual WhileASTtoWhile (void)
 Get the repetition AST if this AST is a repeatition, null else. More...
 
virtual DoWhileASTtoDoWhile (void)
 Get the repetition AST if this AST is a repetition, null else. More...
 
virtual ForASTtoFor (void)
 Get the repetition AST if this AST is a repetition, null else. More...
 
void lock (void)
 
void unlock ()
 
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 Identifier< AST * > ID
 The property matching the given identifier is put on the first instruction of the AST. More...
 
static ASTNOP = nop_inst
 Unique instance of the NOP AST. More...
 
static ASTUNDEF = undef_inst
 Unique instance of the Undef AST. More...
 
static const PropList EMPTY
 This is an empty proplist for convenience. More...
 

Private Attributes

FunASTfun
 

Detailed Description

This class is a specialized block AST ended by a function call.

Constructor & Destructor Documentation

otawa::ast::CallAST::CallAST ( Inst block,
ot::size  size,
FunAST _fun 
)

Build a new AST call calling the given function.

Parameters
blockFirst instruction of the block.
sizeSize of the block.
_funCalled function.
otawa::ast::CallAST::CallAST ( WorkSpace ws,
Inst block,
ot::size  size,
Inst callee 
)

Build a call AST with only the first instruction of the called function.

Parameters
wsContainer workspace.
blockFirst instruction of the caller block.
sizeSize of the caller block.
calleeCallee instruction.

References fun, otawa::ast::ASTInfo::getFunction(), and otawa::ast::INFO.

Member Function Documentation

Inst * otawa::ast::BlockAST::block ( void  ) const
inlineinherited
void otawa::PropList::clearProps ( void  )
inherited
int otawa::ast::BlockAST::countInstructions ( void  ) const
virtualinherited

Count the number of instructions in the ast block.

Returns
Number of instruction in the ast block.

Implements otawa::ast::AST.

References otawa::ast::BlockAST::_block, otawa::ast::BlockAST::_size, and otawa::ProgItem::address().

Referenced by otawa::ets::TrivialAstBlockTime::processAST().

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

bool otawa::ast::AST::isNOP ( void  )
inlinevirtualinherited

Test if the AST is the NOP AST.

Returns
True if it is the NOP AST, false else.
bool otawa::ast::AST::isUndef ( void  )
inlinevirtualinherited

Test if the AST is the undefined AST.

Returns
True if it is the undefined AST, false else.
virtual ast_kind_t otawa::ast::CallAST::kind ( void  ) const
inlinevirtual

Get the kind of the AST.

Reimplemented from otawa::ast::BlockAST.

References otawa::ast::AST_Call.

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::ast::AST::release ( void  )
virtualinherited
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
t::uint32 otawa::ast::BlockAST::size ( void  ) const
inlineinherited
virtual BlockAST* otawa::ast::BlockAST::toBlock ( void  )
inlinevirtualinherited

Get the block AST if this AST is a block, null else.

Returns
Block AST or null.

Reimplemented from otawa::ast::AST.

virtual CallAST* otawa::ast::CallAST::toCall ( void  )
inlinevirtual

Get the call AST if this AST is a call, null else.

Returns
Call AST or null.

Reimplemented from otawa::ast::AST.

Member Data Documentation

const PropList otawa::PropList::EMPTY
staticinherited

This is an empty proplist for convenience.

FunAST* otawa::ast::CallAST::fun
private

Referenced by CallAST(), and function().

Identifier< AST * > otawa::ast::BlockAST::ID
staticinherited

The property matching the given identifier is put on the first instruction of the AST.

The property contains a pointer to the block AST.

Referenced by otawa::ast::BlockAST::BlockAST().

AST & otawa::ast::AST::NOP = nop_inst
staticinherited

Unique instance of the NOP AST.

AST & otawa::ast::AST::UNDEF = undef_inst
staticinherited

Unique instance of the Undef AST.


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