Otawa  0.10
otawa::se::SEReg Class Reference

Register. More...

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

Inheritance diagram for otawa::se::SEReg:
otawa::se::SymbExpr

Public Member Functions

 SEReg (V value, SymbExpr *parent=NULL)
 Constructors. More...
 
 SEReg (const SEReg &expr)
 Copy constructor. More...
 
virtual SERegcopy (void)
 Operators. More...
 
virtual SymbExproperator= (const SEReg &expr)
 Affectation operator. More...
 
virtual bool operator== (const SymbExpr &expr) const
 Not equal operator. More...
 
virtual String asString (const hard::Platform *pf=0)
 Operation. More...
 
virtual void canonize (void)
 Try to recursively transform the expression into it its canonized form. More...
 
virtual Vector< Vused_reg (void)
 Return the list of registers used (recursively) in this expression. More...
 
bool operator!= (const SymbExpr &expr) const
 Not equal operator. More...
 
op_t op (void) const
 Accessors. More...
 
SymbExpra (void) const
 
SymbExprb (void) const
 
V val (void) const
 
SymbExprparent (void) const
 
void replace (SymbExpr *searched_se, SymbExpr *new_se)
 Operation. More...
 
void print (io::Output &out, const hard::Platform *pf=0)
 Output a string representation of the expression. More...
 
virtual Vector< Vused_addr (void)
 Return the list of memory addresses used (recursively) in this expression. More...
 
void set_a (SymbExpr *a)
 Setters. More...
 
void set_b (SymbExpr *b)
 Set the second child expression (b) More...
 
void set_parent (SymbExpr *parent)
 Set the reference to the parent of this. More...
 

Protected Attributes

op_t _op
 Attributes. More...
 
SymbExpr_a
 
SymbExpr_b
 
V _val
 
SymbExpr_parent
 

Detailed Description

Register.

Constructor & Destructor Documentation

otawa::se::SEReg::SEReg ( V  value,
SymbExpr parent = NULL 
)
inline

Constructors.

Build a new Register Symbolic Expression [R value]

Parameters
valuethe identifier of the register (<0 for temp registers)
parenta pointer to the parent

Referenced by copy().

otawa::se::SEReg::SEReg ( const SEReg expr)
inline

Copy constructor.

Parameters
exprthe expression to copy

Member Function Documentation

String otawa::se::SEReg::asString ( const hard::Platform pf = 0)
virtual

Operation.

Returns
a string reprensentation of the expression

Reimplemented from otawa::se::SymbExpr.

References _, otawa::se::SymbExpr::_val, otawa::hard::Platform::findReg(), otawa::clp::Value::isConst(), otawa::clp::Value::lower(), and name.

SymbExpr* otawa::se::SymbExpr::b ( void  ) const
inlineinherited
void otawa::se::SEReg::canonize ( void  )
virtual

Try to recursively transform the expression into it its canonized form.

Reimplemented from otawa::se::SymbExpr.

SEReg * otawa::se::SEReg::copy ( void  )
virtual

Operators.

Copy operator

Returns
a pointer to a copy of this

Reimplemented from otawa::se::SymbExpr.

References otawa::se::SymbExpr::_val, and SEReg().

bool otawa::se::SymbExpr::operator!= ( const SymbExpr expr) const
inherited

Not equal operator.

Parameters
exprthe expression to be compared with this
Returns
if the expression doesn't reprensents the same as expr

References otawa::se::SymbExpr::operator==().

SymbExpr & otawa::se::SEReg::operator= ( const SEReg expr)
virtual

Affectation operator.

Parameters
exprthe expression to be copied in this
Returns
this

References otawa::se::SymbExpr::_op, and otawa::se::SymbExpr::_val.

bool otawa::se::SEReg::operator== ( const SymbExpr expr) const
virtual

Not equal operator.

Parameters
exprthe expression to be compared with this
Returns
if the expression doesn't reprensents the same as expr

Reimplemented from otawa::se::SymbExpr.

References otawa::se::SymbExpr::_op, otawa::se::SymbExpr::_val, otawa::se::SymbExpr::op(), and otawa::se::SymbExpr::val().

SymbExpr* otawa::se::SymbExpr::parent ( void  ) const
inlineinherited
Returns
a pointer to the parent of this (or NULL)
void otawa::se::SymbExpr::print ( io::Output out,
const hard::Platform pf = 0 
)
inherited

Output a string representation of the expression.

Parameters
outthe output channel
pfcurrent plarform

References otawa::se::SymbExpr::asString().

Referenced by otawa::se::FilterBuilder::makeFilters(), and operator<<().

void otawa::se::SymbExpr::replace ( SymbExpr searched_se,
SymbExpr new_se 
)
inherited

Operation.

Recursively replace in this the searched_se expression by new_se

Parameters
searched_sethe researched expression
new_sethe expression that will replace searched_se

new_se will be copied each time it replace a searched_se.

References otawa::se::SymbExpr::_a, otawa::se::SymbExpr::_b, otawa::se::SymbExpr::replace(), otawa::se::SymbExpr::set_a(), and otawa::se::SymbExpr::set_b().

Referenced by otawa::se::getFilterForAddr(), otawa::se::getFilterForReg(), otawa::se::FilterBuilder::makeFilters(), and otawa::se::SymbExpr::replace().

void otawa::se::SymbExpr::set_a ( SymbExpr a)
inlineinherited

Setters.

Set the first child expression (a)

Parameters
aa pointer to the new first child

A copy of a will be set as first child. If there was a first child in this expression, it will be delete, but after the copy of a (so it's safe to set_a() a child expression of this->a()).

References otawa::se::SymbExpr::copy(), and otawa::se::SymbExpr::set_parent().

Referenced by otawa::se::SENeg::canonize(), otawa::se::SEAdd::canonize(), otawa::se::SymbExpr::operator=(), otawa::se::SENeg::operator=(), otawa::se::SEAdd::operator=(), otawa::se::SECmp::operator=(), and otawa::se::SymbExpr::replace().

void otawa::se::SymbExpr::set_b ( SymbExpr b)
inlineinherited

Set the second child expression (b)

Parameters
ba pointer to the new second child

A copy of b will be set as second child. If there was a second child in this expression, it will be delete, but after the copy of b (so it's safe to set_b() a child expression of this->b()).

References otawa::se::SymbExpr::copy(), and otawa::se::SymbExpr::set_parent().

Referenced by otawa::se::SENeg::canonize(), otawa::se::SEAdd::canonize(), otawa::se::SymbExpr::operator=(), otawa::se::SEAdd::operator=(), otawa::se::SECmp::operator=(), and otawa::se::SymbExpr::replace().

void otawa::se::SymbExpr::set_parent ( SymbExpr parent)
inlineinherited

Set the reference to the parent of this.

Parameters
parenta pointer to the new parent.

Warning: this do not remove the reference to this in the old parent.

Referenced by otawa::se::SymbExpr::set_a(), and otawa::se::SymbExpr::set_b().

Vector< V > otawa::se::SymbExpr::used_addr ( void  )
virtualinherited
Vector< V > otawa::se::SEReg::used_reg ( void  )
virtual

Return the list of registers used (recursively) in this expression.

Returns
a vector of int

Reimplemented from otawa::se::SymbExpr.

References otawa::se::SymbExpr::_val, and elm::genstruct::Vector< T >::add().

V otawa::se::SymbExpr::val ( void  ) const
inlineinherited

Member Data Documentation

SymbExpr* otawa::se::SymbExpr::_parent
protectedinherited

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