Otawa
0.10
|
A variable is an identifier used for performing ILP computation. 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 | |
virtual | ~Var (void) |
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... | |
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... | |
Protected Member Functions | |
Var (type_t type=INT) | |
Build an anonymous variable. More... | |
Var (cstring name, type_t type=INT) | |
Var (const string &name, type_t type=INT) | |
Build a variable with the given name. More... | |
Private Attributes | |
string | _name |
type_t | _type |
A variable is an identifier used for performing ILP computation.
A variable may named or not and may inserted as any property. Have just a thought about releasing it.
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. |
|
virtual |
|
virtual |
Evaluate the variable in the given system.
sys | Resolved system to look in. |
Reimplemented in otawa::ilp::Alias.
References otawa::ilp::System::valueOf().
|
inline |
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<<().
|
virtual |
Print the name of the variable.
out | Output to use. |
References _name.
Referenced by otawa::ilp::operator<<().
|
virtual |
If the variable is an alias, return it.
Reimplemented in otawa::ilp::Alias.
Referenced by otawa::ilp::Expression::add().
|
inline |
Get the type of the variable.
|
private |