Otawa  0.10
otawa::sem::PathIter Class Reference

This iterator allows easily to traverse all execution paths of a block of semantic instructions. More...

#include <otawa/sem/PathIter.h>

Inheritance diagram for otawa::sem::PathIter:
elm::PreIterator< PathIter, sem::inst >

Public Member Functions

void start (Inst *inst)
 
bool pathEnd (void) const
 Test if the current instruction is a path end. More...
 
bool isCond (void) const
 Test if the current instruction is a conditional, that means that two different paths will be created from this point. More...
 
bool ended (void) const
 
sem::inst item (void) const
 
void next (void)
 
opcode op (void) const
 
t::int16 d (void) const
 
t::int16 a (void) const
 
t::int16 b (void) const
 
t::uint32 cst (void) const
 
t::uint32 reg (void) const
 
t::uint32 addr (void) const
 
 operator bool (void) const
 
 operator sem::inst (void) const
 
PathIteroperator++ (void)
 
PathIteroperator++ (int)
 
sem::inst operator* (void) const
 
sem::inst operator-> (void) const
 

Private Attributes

Inst_inst
 
sem::Block bb
 
genstruct::Vector< int > todo
 
int pc
 

Detailed Description

This iterator allows easily to traverse all execution paths of a block of semantic instructions.

As it may consume resources, it is delivered to support iteration on multiple blocks sequentially.

Member Function Documentation

t::int16 otawa::sem::PathIter::a ( void  ) const
inline

References otawa::sem::inst::a, and item().

t::uint32 otawa::sem::PathIter::addr ( void  ) const
inline

References otawa::sem::inst::addr(), and item().

t::int16 otawa::sem::PathIter::b ( void  ) const
inline

References otawa::sem::inst::b, and item().

t::uint32 otawa::sem::PathIter::cst ( void  ) const
inline

References otawa::sem::inst::cst, and item().

t::int16 otawa::sem::PathIter::d ( void  ) const
inline

References otawa::sem::inst::d(), and item().

bool otawa::sem::PathIter::ended ( void  ) const
inline
bool otawa::sem::PathIter::isCond ( void  ) const
inline

Test if the current instruction is a conditional, that means that two different paths will be created from this point.

Returns
True if it is a condition, false else.

References bb, otawa::sem::IF, and pc.

Referenced by otawa::stack::Iter::isCond(), and next().

sem::inst otawa::sem::PathIter::item ( void  ) const
inline
void otawa::sem::PathIter::next ( void  )
inline
opcode otawa::sem::PathIter::op ( void  ) const
inline

References item().

elm::PreIterator< PathIter , sem::inst >::operator bool ( void  ) const
inherited
elm::PreIterator< PathIter , sem::inst >::operator sem::inst ( void  ) const
inherited
sem::inst elm::PreIterator< PathIter , sem::inst >::operator* ( void  ) const
inherited
PathIter & elm::PreIterator< PathIter , sem::inst >::operator++ ( void  )
inherited
PathIter & elm::PreIterator< PathIter , sem::inst >::operator++ ( int  )
inherited
sem::inst elm::PreIterator< PathIter , sem::inst >::operator-> ( void  ) const
inherited
bool otawa::sem::PathIter::pathEnd ( void  ) const
inline

Test if the current instruction is a path end.

Returns
True if it is a path end, false else.

References bb, otawa::sem::CONT, and pc.

Referenced by ended(), next(), otawa::stack::Iter::next(), and otawa::stack::Iter::pathEnd().

t::uint32 otawa::sem::PathIter::reg ( void  ) const
inline

References item(), and otawa::sem::inst::reg().

Member Data Documentation

Inst* otawa::sem::PathIter::_inst
private

Referenced by start().

sem::Block otawa::sem::PathIter::bb
private

Referenced by isCond(), item(), next(), pathEnd(), and start().

int otawa::sem::PathIter::pc
private

Referenced by isCond(), item(), next(), pathEnd(), and start().

genstruct::Vector<int> otawa::sem::PathIter::todo
private

Referenced by ended(), next(), and start().


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