Otawa
0.10
|
An alias is a specific variable that represents an expressions. More...
#include <otawa/ilp/Var.h>
Public Types | |
enum | type_t { NO_TYPE = 0, INT = 1, BIN = 2, FLOAT = 3 } |
Type of an ILP variable. More... | |
Public Member Functions | |
Alias (Expression *expr) | |
Build an anonymous alias variable. More... | |
Alias (string name, Expression *expr) | |
Build a named alias variable. More... | |
virtual | ~Alias (void) |
virtual Alias * | toAlias (void) |
If the variable is an alias, return it. More... | |
virtual double | eval (System *sys) |
Evaluate the variable in the given system. More... | |
const Expression * | expression (void) const |
const string & | name (void) const |
Get the name of the variable if any. More... | |
type_t | type (void) const |
Get the type of the variable. More... | |
virtual void | print (io::Output &out) |
Print the name of the variable. More... | |
Private Attributes | |
Expression * | _expr |
An alias is a specific variable that represents an expressions.
This allows to reduce the number of true variable and to replace any variable by any possible expression.
|
inherited |
Type of an ILP variable.
Enumerator | |
---|---|
NO_TYPE |
Null value for ILP variable type. |
INT |
Integer (default) type for ILP variable. |
BIN |
Binary type (0 or 1) for ILP variable. |
FLOAT |
Real type for ILP variable. |
otawa::ilp::Alias::Alias | ( | Expression * | expr | ) |
Build an anonymous alias variable.
expr | Expression of the alias (this object is responsible for freeing it). |
otawa::ilp::Alias::Alias | ( | string | name, |
Expression * | expr | ||
) |
Build a named alias variable.
name | Name of the variable. |
expr | Expression of the alias (this object is responsible for freeing it). |
|
virtual |
References _expr.
|
virtual |
Evaluate the variable in the given system.
sys | Resolved system to look in. |
Reimplemented from otawa::ilp::Var.
References _expr, and otawa::ilp::Expression::eval().
|
inline |
Referenced by otawa::ilp::Expression::add().
|
inlineinherited |
Get the name of the variable if any.
Return an empty string if there is none.
Referenced by otawa::tsim::BBPath::makeVarName(), otawa::display::ILPSystemDisplayer::nameOf(), and otawa::ilp::operator<<().
|
virtualinherited |
Print the name of the variable.
out | Output to use. |
References otawa::ilp::Var::_name.
Referenced by otawa::ilp::operator<<().
|
virtual |
If the variable is an alias, return it.
Reimplemented from otawa::ilp::Var.
|
inlineinherited |
Get the type of the variable.
|
private |