Otawa  0.10
otawa::stack::Value Class Reference

Values in the StackAnalysis. More...

#include <otawa/stack/features.h>

Public Types

typedef t::uint32 int_t
 
typedef t::int32 signed_t
 
typedef t::uint64 upper_t
 

Public Member Functions

 Value (void)
 
 Value (kind_t k, int_t v=0)
 Construct for a value. More...
 
Valueoperator= (const Value &val)
 
bool isTop (void) const
 
bool isBot (void) const
 
bool isReg (void) const
 
bool isSP (void) const
 
bool isConst (void) const
 
bool operator== (const Value &val) const
 
bool operator!= (const Value &val) const
 
bool operator< (const Value &val) const
 
kind_t kind (void) const
 Get the kind of the value. More...
 
int_t value (void) const
 
void add (const Value &val)
 Perform addition of values. More...
 
void sub (const Value &val)
 Perform subtraction of values. More...
 
void shl (const Value &val)
 Left-shit on a value. More...
 
void shr (const Value &val)
 Right-shift on a value. More...
 
void asr (const Value &val)
 Arithmetic right-shift on a value. More...
 
void neg (void)
 Invert sign of value. More...
 
void _not (void)
 Invert bits of the value. More...
 
void _or (const Value &val)
 Perform OR operator on values (modifying current one). More...
 
void _and (const Value &val)
 Perform AND operator on values (modifying current one). More...
 
void _xor (const Value &val)
 Perform XOR operator on values (modifying current one). More...
 
void mul (const Value &val)
 Perform MUL operator on values (modifying current one). More...
 
void div (const Value &val)
 Perform division on values (modifying current one). More...
 
void divu (const Value &val)
 Perform division on values (modifying current one). More...
 
void mod (const Value &val)
 Perform modulo on values (modifying current one). More...
 
void modu (const Value &val)
 Perform modulo on values (modifying current one). More...
 
void mulh (const Value &val)
 Compute upper-word multiplication on values (modifying current one). More...
 
void join (const Value &val)
 Join of values. More...
 
void print (io::Output &out) const
 Print the value. More...
 

Static Public Member Functions

static Value reg (int n)
 
static Value addr (Address a)
 
static Value cst (int_t k)
 
static Value sp (int_t off)
 

Static Public Attributes

static Value bot
 Bottom value (uninitialized value). More...
 
static Value top
 Top value (any value). More...
 
static const Valuenone = bot
 
static const Value all = top
 undefined value More...
 

Private Types

typedef t::int32 page_t
 

Private Member Functions

 Value (page_t page, int_t val=0)
 
void set (page_t kind, int_t value)
 

Private Attributes

page_t _page
 
int_t _val
 

Static Private Attributes

static const int_t bot_id = -1
 
static const int_t top_id = -2
 
static const page_t spec_page = Address::null_page - 2
 
static const page_t sp_page = Address::null_page - 1
 

Detailed Description

Values in the StackAnalysis.

A value may be:

  • none (NONE) – undefined value,
  • absolute (CST) – constant value,
  • stack relative (SP) – offset relative to the initial address of the stack,
  • all (ALL) – any value.

Member Typedef Documentation

Constructor & Destructor Documentation

otawa::stack::Value::Value ( page_t  page,
int_t  val = 0 
)
inlineprivate
otawa::stack::Value::Value ( void  )
inline

Referenced by addr(), cst(), reg(), and sp().

otawa::stack::Value::Value ( kind_t  k,
int_t  v = 0 
)

Member Function Documentation

void otawa::stack::Value::_and ( const Value val)

Perform AND operator on values (modifying current one).

Parameters
valThe value to OR with the current one.

References _val, isBot(), and isConst().

void otawa::stack::Value::_not ( void  )

Invert bits of the value.

void otawa::stack::Value::_or ( const Value val)

Perform OR operator on values (modifying current one).

Parameters
valThe value to OR with the current one.

References _val, isBot(), and isConst().

void otawa::stack::Value::_xor ( const Value val)

Perform XOR operator on values (modifying current one).

Parameters
valThe value to OR with the current one.

References _val, isBot(), and isConst().

void otawa::stack::Value::add ( const Value val)

Perform addition of values.

References _val, isBot(), isConst(), and isSP().

static Value otawa::stack::Value::addr ( Address  a)
inlinestatic

References Value().

void otawa::stack::Value::asr ( const Value val)

Arithmetic right-shift on a value.

References _val, isBot(), and isConst().

static Value otawa::stack::Value::cst ( int_t  k)
inlinestatic

References Value().

void otawa::stack::Value::div ( const Value val)

Perform division on values (modifying current one).

Parameters
valThe value to OR with the current one.

References _val, isBot(), and isConst().

void otawa::stack::Value::divu ( const Value val)

Perform division on values (modifying current one).

Parameters
valThe value to OR with the current one.

References _val, isBot(), and isConst().

bool otawa::stack::Value::isBot ( void  ) const
inline

References _page, _val, bot_id, and spec_page.

Referenced by _and(), _or(), _xor(), add(), asr(), div(), divu(), join(), mod(), modu(), mul(), mulh(), shl(), shr(), and sub().

bool otawa::stack::Value::isConst ( void  ) const
inline

References _page, and sp_page.

Referenced by _and(), _or(), _xor(), add(), asr(), div(), divu(), mod(), modu(), mul(), mulh(), shl(), shr(), and sub().

bool otawa::stack::Value::isReg ( void  ) const
inline

References _page, _val, and spec_page.

bool otawa::stack::Value::isSP ( void  ) const
inline

References _page, and sp_page.

Referenced by add().

bool otawa::stack::Value::isTop ( void  ) const
inline

References _page, _val, spec_page, and top_id.

void otawa::stack::Value::join ( const Value val)

Join of values.

References isBot().

kind_t otawa::stack::Value::kind ( void  ) const

Get the kind of the value.

Returns
Kind of the value.
Deprecated:
Usage must be replaced by "isXXX"() methods.

References otawa::clp::ALL, otawa::stack::CST, otawa::clp::NONE, otawa::clp::REG, and otawa::stack::SP.

Referenced by set().

void otawa::stack::Value::mod ( const Value val)

Perform modulo on values (modifying current one).

Parameters
valThe value to OR with the current one.

References _val, isBot(), and isConst().

void otawa::stack::Value::modu ( const Value val)

Perform modulo on values (modifying current one).

Parameters
valThe value to OR with the current one.

References _val, isBot(), and isConst().

void otawa::stack::Value::mul ( const Value val)

Perform MUL operator on values (modifying current one).

Parameters
valThe value to OR with the current one.

References _val, isBot(), and isConst().

void otawa::stack::Value::mulh ( const Value val)

Compute upper-word multiplication on values (modifying current one).

Parameters
valThe value to OR with the current one.

References _val, isBot(), and isConst().

void otawa::stack::Value::neg ( void  )

Invert sign of value.

bool otawa::stack::Value::operator!= ( const Value val) const
inline

References operator==().

bool otawa::stack::Value::operator< ( const Value val) const
inline

References _page, and _val.

Value& otawa::stack::Value::operator= ( const Value val)
inline

References _page, and _val.

bool otawa::stack::Value::operator== ( const Value val) const
inline

References _page, and _val.

Referenced by operator!=().

void otawa::stack::Value::print ( io::Output out) const

Print the value.

References elm::io::hex().

Referenced by otawa::stack::operator<<().

static Value otawa::stack::Value::reg ( int  n)
inlinestatic

References spec_page, and Value().

void otawa::stack::Value::set ( page_t  kind,
int_t  value 
)
inlineprivate

References _page, _val, kind(), and value().

void otawa::stack::Value::shl ( const Value val)

Left-shit on a value.

References _val, isBot(), and isConst().

void otawa::stack::Value::shr ( const Value val)

Right-shift on a value.

References _val, isBot(), and isConst().

static Value otawa::stack::Value::sp ( int_t  off)
inlinestatic

References sp_page, and Value().

void otawa::stack::Value::sub ( const Value val)

Perform subtraction of values.

References _val, isBot(), and isConst().

int_t otawa::stack::Value::value ( void  ) const
inline

References _val.

Referenced by set().

Member Data Documentation

page_t otawa::stack::Value::_page
private
int_t otawa::stack::Value::_val
private
const Value otawa::stack::Value::all = top
static

undefined value

Value otawa::stack::Value::bot
static

Bottom value (uninitialized value).

const int_t otawa::stack::Value::bot_id = -1
staticprivate

Referenced by isBot().

const Value & otawa::stack::Value::none = bot
static
const page_t otawa::stack::Value::sp_page = Address::null_page - 1
staticprivate

Referenced by isConst(), isSP(), and sp().

const page_t otawa::stack::Value::spec_page = Address::null_page - 2
staticprivate

Referenced by isBot(), isReg(), isTop(), and reg().

Value otawa::stack::Value::top
static

Top value (any value).

const int_t otawa::stack::Value::top_id = -2
staticprivate

Referenced by isTop().


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