VirtualMachineSemantics::ValueType< nBits > Struct Template Reference

#include <VirtualMachineSemantics.h>

Inheritance diagram for VirtualMachineSemantics::ValueType< nBits >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<size_t nBits>
struct VirtualMachineSemantics::ValueType< nBits >

A value is either known or unknown.

Unknown values have a base name (unique ID number), offset, and sign.


Public Member Functions

 ValueType ()
 Construct a value that is unknown and unique.
template<size_t Len>
 ValueType (const ValueType< Len > &other)
 Copy-construct a value, truncating or extending at msb the source value.
 ValueType (uint64_t n)
 Construct a ValueType with a known value.
 ValueType (uint64_t name, uint64_t offset, bool negate=false)
 Low-level constructor used internally.
bool is_known () const
 Returns true if the value is known, false if the value only has a name.
uint64_t known_value () const
 Returns the value if it is known.
ValueType< nBits > rename (RenameMap *rmap=NULL) const
 Returns a new, optionally renamed, value.
void print (std::ostream &o, RenameMap *rmap=NULL) const
 Print the value.

Public Attributes

uint64_t name
 Zero for constants; non-zero ID number for everything else.
uint64_t offset
 The constant (if name==0) or an offset w.r.t.
bool negate
 Switch between name+offset and (-name)+offset; should be false for constants.

Friends

bool operator== (const ValueType &a, const ValueType &b)
bool operator!= (const ValueType &a, const ValueType &b)
bool operator< (const ValueType &a, const ValueType &b)


Constructor & Destructor Documentation

template<size_t nBits>
VirtualMachineSemantics::ValueType< nBits >::ValueType (  )  [inline]

Construct a value that is unknown and unique.

template<size_t nBits>
template<size_t Len>
VirtualMachineSemantics::ValueType< nBits >::ValueType ( const ValueType< Len > &  other  )  [inline]

Copy-construct a value, truncating or extending at msb the source value.

template<size_t nBits>
VirtualMachineSemantics::ValueType< nBits >::ValueType ( uint64_t  n  )  [inline]

Construct a ValueType with a known value.

template<size_t nBits>
VirtualMachineSemantics::ValueType< nBits >::ValueType ( uint64_t  name,
uint64_t  offset,
bool  negate = false 
) [inline]

Low-level constructor used internally.


Member Function Documentation

template<size_t nBits>
bool VirtualMachineSemantics::ValueType< nBits >::is_known (  )  const [inline]

Returns true if the value is known, false if the value only has a name.

template<size_t nBits>
uint64_t VirtualMachineSemantics::ValueType< nBits >::known_value (  )  const [inline]

Returns the value if it is known.

template<size_t Len>
ValueType< Len > VirtualMachineSemantics::ValueType< Len >::rename ( RenameMap rmap = NULL  )  const

Returns a new, optionally renamed, value.

If the rename map, rmap, is non-null and this value is a named value, then its name will be transformed by looking up the name in the map and using the value found there. If the name is not in the map then a new entry is created in the map. Remapped names start counting from one. For example, if "v904885611+0xfc" is the first value to be renamed, it will become "v1+0xfc".

template<size_t nBits>
void VirtualMachineSemantics::ValueType< nBits >::print ( std::ostream &  o,
RenameMap rmap = NULL 
) const [inline]

Print the value.

If a rename map is specified a named value will be renamed to have a shorter name. See the rename() method for details.


Friends And Related Function Documentation

template<size_t nBits>
bool operator== ( const ValueType< nBits > &  a,
const ValueType< nBits > &  b 
) [friend]

template<size_t nBits>
bool operator!= ( const ValueType< nBits > &  a,
const ValueType< nBits > &  b 
) [friend]

template<size_t nBits>
bool operator< ( const ValueType< nBits > &  a,
const ValueType< nBits > &  b 
) [friend]


Member Data Documentation

template<size_t nBits>
uint64_t VirtualMachineSemantics::ValueType< nBits >::name

Zero for constants; non-zero ID number for everything else.

template<size_t nBits>
uint64_t VirtualMachineSemantics::ValueType< nBits >::offset

The constant (if name==0) or an offset w.r.t.

an unknown (named) base value.

template<size_t nBits>
bool VirtualMachineSemantics::ValueType< nBits >::negate

Switch between name+offset and (-name)+offset; should be false for constants.


The documentation for this struct was generated from the following file:
Generated on Tue Jan 31 05:46:35 2012 for ROSE by  doxygen 1.4.7