Otawa
0.10
|
Symbolic expression. More...
#include <otawa/data/clp/SymbolicExpr.h>
Public Member Functions | |
SymbExpr (op_t op=NONE, SymbExpr *a=NULL, SymbExpr *b=NULL, V val=0, SymbExpr *parent=NULL) | |
Constructor and destructor. More... | |
SymbExpr (const SymbExpr &expr) | |
Copy constructor. More... | |
virtual | ~SymbExpr () |
Destructor of a symbolic expression This recursively delete a and b childs, and set to NULL the reference of this in the parent (if any). More... | |
virtual SymbExpr * | copy (void) |
Operators. More... | |
virtual SymbExpr & | operator= (const SymbExpr &expr) |
Affectation operator. More... | |
virtual bool | operator== (const SymbExpr &expr) const |
Equality. More... | |
bool | operator!= (const SymbExpr &expr) const |
Not equal operator. More... | |
op_t | op (void) const |
Accessors. More... | |
SymbExpr * | a (void) const |
SymbExpr * | b (void) const |
V | val (void) const |
SymbExpr * | parent (void) const |
void | replace (SymbExpr *searched_se, SymbExpr *new_se) |
Operation. More... | |
virtual String | asString (const hard::Platform *pf=0) |
void | print (io::Output &out, const hard::Platform *pf=0) |
Output a string representation of the expression. More... | |
virtual void | canonize (void) |
Try to recursively transform the expression into it its canonized form. More... | |
virtual Vector< V > | used_reg (void) |
Return the list of registers used (recursively) in this expression. More... | |
virtual Vector< V > | used_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 |
Symbolic expression.
|
inline |
Constructor and destructor.
Build a new symbolic expression You shoul instaciate childs instead of this expression
References otawa::se::NONE, and otawa::se::OR.
Referenced by copy().
|
inline |
Copy constructor.
expr | the expression to copy |
References _a, _b, otawa::se::NONE, and otawa::se::OR.
|
inlinevirtual |
Destructor of a symbolic expression This recursively delete a and b childs, and set to NULL the reference of this in the parent (if any).
|
inline |
Referenced by otawa::se::SENeg::canonize(), otawa::se::SEAdd::canonize(), otawa::se::getFilterForAddr(), otawa::se::getFilterForReg(), otawa::se::FilterBuilder::makeFilters(), otawa::se::SENeg::operator==(), otawa::se::SEAdd::operator==(), and otawa::se::SECmp::operator==().
|
virtual |
Reimplemented in otawa::se::SECmp, otawa::se::SEAdd, otawa::se::SENeg, otawa::se::SEReg, otawa::se::SEAddr, and otawa::se::SEConst.
Referenced by otawa::se::SENeg::asString(), otawa::se::SEAdd::asString(), and print().
|
inline |
Referenced by otawa::se::SENeg::canonize(), otawa::se::SEAdd::canonize(), otawa::se::getFilterForAddr(), otawa::se::getFilterForReg(), otawa::se::FilterBuilder::makeFilters(), otawa::se::SEAdd::operator==(), and otawa::se::SECmp::operator==().
|
virtual |
Try to recursively transform the expression into it its canonized form.
Reimplemented in otawa::se::SECmp, otawa::se::SEAdd, otawa::se::SENeg, otawa::se::SEReg, otawa::se::SEAddr, and otawa::se::SEConst.
References _a, _b, and canonize().
Referenced by canonize(), otawa::se::SENeg::canonize(), and otawa::se::SEAdd::canonize().
|
virtual |
Operators.
Copy operator
Reimplemented in otawa::se::SECmp, otawa::se::SEAdd, otawa::se::SENeg, otawa::se::SEReg, otawa::se::SEAddr, and otawa::se::SEConst.
References _a, _b, _op, _val, copy(), and SymbExpr().
Referenced by otawa::se::SEAdd::canonize(), copy(), otawa::se::SENeg::copy(), otawa::se::SEAdd::copy(), otawa::se::SECmp::copy(), set_a(), and set_b().
|
inline |
Accessors.
Referenced by otawa::se::SENeg::canonize(), otawa::se::SEAdd::canonize(), otawa::se::getFilterForAddr(), otawa::se::getFilterForReg(), otawa::se::FilterBuilder::makeFilters(), otawa::se::SEConst::operator==(), otawa::se::SEAddr::operator==(), otawa::se::SEReg::operator==(), otawa::se::SENeg::operator==(), otawa::se::SEAdd::operator==(), and otawa::se::SECmp::operator==().
bool otawa::se::SymbExpr::operator!= | ( | const SymbExpr & | expr | ) | const |
Not equal operator.
expr | the expression to be compared with this |
References operator==().
|
virtual |
Equality.
expr | the expression to be compared with this |
Reimplemented in otawa::se::SECmp, otawa::se::SEAdd, otawa::se::SENeg, otawa::se::SEReg, otawa::se::SEAddr, and otawa::se::SEConst.
References _op.
Referenced by operator!=().
|
inline |
void otawa::se::SymbExpr::print | ( | io::Output & | out, |
const hard::Platform * | pf = 0 |
||
) |
Output a string representation of the expression.
out | the output channel |
pf | current plarform |
References asString().
Referenced by otawa::se::FilterBuilder::makeFilters(), and operator<<().
Operation.
Recursively replace in this the searched_se expression by new_se
searched_se | the researched expression |
new_se | the expression that will replace searched_se |
new_se will be copied each time it replace a searched_se.
References _a, _b, replace(), set_a(), and set_b().
Referenced by otawa::se::getFilterForAddr(), otawa::se::getFilterForReg(), otawa::se::FilterBuilder::makeFilters(), and replace().
|
inline |
Setters.
Set the first child expression (a)
a | a 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 copy(), and set_parent().
Referenced by otawa::se::SENeg::canonize(), otawa::se::SEAdd::canonize(), operator=(), otawa::se::SENeg::operator=(), otawa::se::SEAdd::operator=(), otawa::se::SECmp::operator=(), and replace().
|
inline |
Set the second child expression (b)
b | a 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 copy(), and set_parent().
Referenced by otawa::se::SENeg::canonize(), otawa::se::SEAdd::canonize(), operator=(), otawa::se::SEAdd::operator=(), otawa::se::SECmp::operator=(), and replace().
|
inline |
Return the list of memory addresses used (recursively) in this expression.
Reimplemented in otawa::se::SEAddr.
References _a, _b, elm::genstruct::Vector< T >::add(), elm::genstruct::Vector< T >::contains(), elm::genstruct::Vector< T >::length(), and used_addr().
Referenced by otawa::se::FilterBuilder::makeFilters(), and used_addr().
Return the list of registers used (recursively) in this expression.
Reimplemented in otawa::se::SEReg.
References _a, _b, elm::genstruct::Vector< T >::add(), elm::genstruct::Vector< T >::contains(), elm::genstruct::Vector< T >::length(), and used_reg().
Referenced by otawa::se::FilterBuilder::makeFilters(), and used_reg().
|
inline |
Referenced by otawa::se::SENeg::canonize(), otawa::se::SEAdd::canonize(), otawa::se::FilterBuilder::makeFilters(), otawa::se::SEConst::operator==(), otawa::se::SEAddr::operator==(), and otawa::se::SEReg::operator==().
|
protected |
Referenced by otawa::se::SENeg::asString(), otawa::se::SEAdd::asString(), canonize(), otawa::se::SENeg::canonize(), otawa::se::SEAdd::canonize(), copy(), otawa::se::SENeg::copy(), otawa::se::SEAdd::copy(), otawa::se::SECmp::copy(), operator=(), otawa::se::SENeg::operator=(), otawa::se::SEAdd::operator=(), otawa::se::SECmp::operator=(), otawa::se::SENeg::operator==(), otawa::se::SEAdd::operator==(), otawa::se::SECmp::operator==(), replace(), SymbExpr(), used_addr(), and used_reg().
|
protected |
Referenced by otawa::se::SEAdd::asString(), canonize(), otawa::se::SEAdd::canonize(), copy(), otawa::se::SEAdd::copy(), otawa::se::SECmp::copy(), operator=(), otawa::se::SEAdd::operator=(), otawa::se::SECmp::operator=(), otawa::se::SEAdd::operator==(), otawa::se::SECmp::operator==(), replace(), SymbExpr(), used_addr(), and used_reg().
|
protected |
Attributes.
Referenced by otawa::se::SECmp::asString(), copy(), otawa::se::SECmp::copy(), operator=(), otawa::se::SEConst::operator=(), otawa::se::SEAddr::operator=(), otawa::se::SEReg::operator=(), otawa::se::SENeg::operator=(), otawa::se::SEAdd::operator=(), otawa::se::SECmp::operator=(), operator==(), otawa::se::SEConst::operator==(), otawa::se::SEAddr::operator==(), otawa::se::SEReg::operator==(), otawa::se::SENeg::operator==(), otawa::se::SEAdd::operator==(), and otawa::se::SECmp::operator==().
|
protected |
Referenced by otawa::se::SENeg::canonize(), and otawa::se::SEAdd::canonize().
|
protected |
Referenced by otawa::se::SEConst::asString(), otawa::se::SEAddr::asString(), otawa::se::SEReg::asString(), copy(), otawa::se::SEConst::copy(), otawa::se::SEAddr::copy(), otawa::se::SEReg::copy(), operator=(), otawa::se::SEConst::operator=(), otawa::se::SEAddr::operator=(), otawa::se::SEReg::operator=(), otawa::se::SEConst::operator==(), otawa::se::SEAddr::operator==(), otawa::se::SEReg::operator==(), otawa::se::SEAddr::used_addr(), and otawa::se::SEReg::used_reg().