Otawa  0.10
otawa::clp::ClpStatePack Class Reference

A pack of CLP states inside a BasicBlock. More...

#include <otawa/data/clp/ClpPack.h>

Classes

class  Context
 A context allows to share a CLP problem through different constructions of ClpStatePack. More...
 
class  InstPack
 A pack of CLP states inside a machine instruction. More...
 

Public Types

typedef Vector< clp::State * >
::Iterator 
StateIterator
 
typedef Vector< InstPack * >
::Iterator 
PackIterator
 

Public Member Functions

 ClpStatePack (BasicBlock *bb, Process *process)
 Constructor of a new ClpStatePack. More...
 
 ClpStatePack (BasicBlock *bb, const Context &context)
 Build a CLP state pack from a context. More...
 
 ~ClpStatePack (void)
 Destructor for ClpStatePack. More...
 
BasicBlockbb (void)
 
PackIterator getIterator (void)
 
clp::State state_after (address_t instruction)
 
clp::State state_after (address_t instruction, int sem)
 
clp::State state_before (address_t instruction)
 
clp::State state_before (address_t instruction, int sem)
 
InstPacknewPack (address_t inst)
 Add a new instruction pack inside the ClpStatePack. More...
 

Private Attributes

BasicBlock_bb
 
Vector< InstPack * > _packs
 

Friends

class ClpProblem
 

Detailed Description

A pack of CLP states inside a BasicBlock.

 A ClpStatePack must be constructed after the run of the ClpAnalysis.

Use it to retreive the state of a specific instruction or semantic instruction.

This constructor will use the input state of the BasicBlock, and run again the analysis until the end of the block.

The state for each instruction and semantic instruction will be saved inside the pack.

Member Typedef Documentation

Constructor & Destructor Documentation

otawa::clp::ClpStatePack::ClpStatePack ( BasicBlock bb,
Process process 
)

Constructor of a new ClpStatePack.

Parameters
bbBasicBlock to be analysed.
processCurrent process.

References _bb, ClpProblem, and otawa::clp::STATE_IN.

otawa::clp::ClpStatePack::ClpStatePack ( BasicBlock bb,
const Context context 
)

Build a CLP state pack from a context.

Parameters
bbBB to analyze.
contextContext to use.

References _bb, otawa::clp::ClpStatePack::Context::problem(), and otawa::clp::STATE_IN.

otawa::clp::ClpStatePack::~ClpStatePack ( void  )

Destructor for ClpStatePack.

References _packs.

Member Function Documentation

BasicBlock* otawa::clp::ClpStatePack::bb ( void  )
inline
Returns
the BasicBlock corresponding to this Pack.

References _bb.

PackIterator otawa::clp::ClpStatePack::getIterator ( void  )
inline
Returns
an iterator over instruction packs.

References _packs.

Referenced by state_after(), and state_before().

ClpStatePack::InstPack * otawa::clp::ClpStatePack::newPack ( address_t  inst)

Add a new instruction pack inside the ClpStatePack.

References _packs.

clp::State otawa::clp::ClpStatePack::state_after ( address_t  instruction)
Returns
the CLP state after the given instruction
Parameters
instructionis the address of the instruction to get the state of.

References otawa::clp::State::EMPTY, getIterator(), otawa::clp::ClpStatePack::InstPack::inst_addr(), and otawa::clp::ClpStatePack::InstPack::outputState().

Referenced by otawa::se::FilterBuilder::makeFilters().

clp::State otawa::clp::ClpStatePack::state_after ( address_t  instruction,
int  sem 
)
Returns
the CLP state after the given semantic instruction
Parameters
instructionis the address of the instruction where the semantic instruction is.
semis the index (starting from 0) of the semantic instruction inside the block corresponding to the machine instruction.

References otawa::clp::ClpStatePack::InstPack::_states, otawa::clp::State::EMPTY, getIterator(), and otawa::clp::ClpStatePack::InstPack::inst_addr().

clp::State otawa::clp::ClpStatePack::state_before ( address_t  instruction)
Returns
the CLP state before the given instruction
Parameters
instructionis the address of the instruction to get the state before.

References _bb, getIterator(), otawa::clp::ClpStatePack::InstPack::inst_addr(), otawa::clp::ClpStatePack::InstPack::outputState(), and otawa::clp::STATE_IN.

Referenced by otawa::se::getFilterForAddr(), and otawa::se::getFilterForReg().

clp::State otawa::clp::ClpStatePack::state_before ( address_t  instruction,
int  sem 
)
Returns
the CLP state before the given semantic instruction
Parameters
instructionis the address of the instruction where the semantic instruction is.
semis the index (starting from 0) of the semantic instruction inside the block corresponding to the machine instruction.

References _bb, otawa::clp::ClpStatePack::InstPack::_states, getIterator(), otawa::clp::ClpStatePack::InstPack::inst_addr(), otawa::clp::ClpStatePack::InstPack::isEmpty(), otawa::clp::ClpStatePack::InstPack::outputState(), and otawa::clp::STATE_IN.

Friends And Related Function Documentation

friend class ClpProblem
friend

Member Data Documentation

BasicBlock* otawa::clp::ClpStatePack::_bb
private

Referenced by bb(), ClpStatePack(), and state_before().

Vector<InstPack*> otawa::clp::ClpStatePack::_packs
private

Referenced by getIterator(), newPack(), and ~ClpStatePack().


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