Otawa  0.10
otawa::se::SEAdd Class Reference

Addition. More...

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

Inheritance diagram for otawa::se::SEAdd:
otawa::se::SymbExpr

Public Member Functions

 SEAdd (SymbExpr *a=NULL, SymbExpr *b=NULL, SymbExpr *parent=NULL)
 Constructors. More...
 
 SEAdd (const SEAdd &expr)
 Copy constructor. More...
 
virtual SEAddcopy (void)
 Operators. More...
 
virtual SymbExproperator= (const SEAdd &expr)
 Affectation operator. More...
 
virtual bool operator== (const SymbExpr &expr) const
 Equality. 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...
 
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_reg (void)
 Return the list of registers used (recursively) in this 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

Addition.

Constructor & Destructor Documentation

otawa::se::SEAdd::SEAdd ( SymbExpr a = NULL,
SymbExpr b = NULL,
SymbExpr parent = NULL 
)
inline

Constructors.

Build a new Addition Symbolic Expression [+ a b]

Parameters
ais a pointer to the first child expression. This pointer will be used as is (no copy), so make sure you 'new' or '->copy()' the expression before.
bis a pointer to the second child expression. This pointer will be used as is (no copy), so make sure you 'new' or '->copy()' the expression before.
parenta pointer to the parent

Referenced by canonize(), and copy().

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

Copy constructor.

Parameters
exprthe expression to copy

Member Function Documentation

SymbExpr* otawa::se::SymbExpr::a ( void  ) const
inlineinherited
String otawa::se::SEAdd::asString ( const hard::Platform pf = 0)
virtual

Operation.

Returns
a string reprensentation of the expression

Reimplemented from otawa::se::SymbExpr.

References _, otawa::se::SymbExpr::_a, otawa::se::SymbExpr::_b, and otawa::se::SymbExpr::asString().

SymbExpr* otawa::se::SymbExpr::b ( void  ) const
inlineinherited
SEAdd * otawa::se::SEAdd::copy ( void  )
virtual

Operators.

Copy operator

Returns
a pointer to a copy of this

Reimplemented from otawa::se::SymbExpr.

References otawa::se::SymbExpr::_a, otawa::se::SymbExpr::_b, otawa::se::SymbExpr::copy(), and SEAdd().

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::SEAdd::operator= ( const SEAdd expr)
virtual

Affectation operator.

Parameters
exprthe expression to be copied in this
Returns
this

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

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

Equality.

Parameters
exprthe expression to be compared with this
Returns
if the expression reprensents the same as expr (recursively)

Reimplemented from otawa::se::SymbExpr.

References otawa::se::SymbExpr::_a, otawa::se::SymbExpr::_b, otawa::se::SymbExpr::_op, otawa::se::SymbExpr::a(), otawa::se::SymbExpr::b(), and otawa::se::SymbExpr::op().

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(), canonize(), otawa::se::SymbExpr::operator=(), otawa::se::SENeg::operator=(), 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(), canonize(), otawa::se::SymbExpr::operator=(), 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::SymbExpr::used_reg ( void  )
virtualinherited
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: