ROSE 0.11.145.141
|
Type of symbolic expression.
Definition at line 222 of file SymbolicExpression.h.
#include <Rose/BinaryAnalysis/SymbolicExpression.h>
Public Types | |
enum | TypeClass { INTEGER , FP , MEMORY , INVALID } |
Type class. More... | |
Public Member Functions | |
Type () | |
Create an invalid, empty type. | |
bool | isValid () const |
Check whether this object is valid. | |
TypeClass | typeClass () const |
Property: Type class. | |
size_t | nBits () const |
Property: Total width of values. | |
size_t | addressWidth () const |
Property: Width of memory addresses. | |
size_t | exponentWidth () const |
Property: Exponent width. | |
size_t | significandWidth () const |
Property: Significand width. | |
bool | operator< (const Type &other) const |
Type comparison. | |
void | print (std::ostream &, TypeStyle::Flag style=TypeStyle::FULL) const |
Print the type. | |
std::string | toString (TypeStyle::Flag style=TypeStyle::FULL) const |
Print the type to a string. | |
bool | operator== (const Type &other) const |
Type equality. | |
bool | operator!= (const Type &other) const |
Type equality. | |
Static Public Member Functions | |
static Type | none () |
Create no type. | |
static Type | integer (size_t nBits) |
Create a new integer type. | |
static Type | memory (size_t addressWidth, size_t valueWidth) |
Create a new memory type. | |
static Type | floatingPoint (size_t exponentWidth, size_t significandWidth) |
Create a new floating-point type. | |
Type class.
Enumerator | |
---|---|
INTEGER | Integer type. |
FP | Floating-point type. |
MEMORY | Memory type. |
INVALID | Default constructed. |
Definition at line 225 of file SymbolicExpression.h.
|
inline |
Create an invalid, empty type.
This is used mainly for default arguments.
Definition at line 263 of file SymbolicExpression.h.
References INVALID, nBits(), and typeClass().
Referenced by floatingPoint(), integer(), memory(), and none().
|
inlinestatic |
Create no type.
This is the same as a default constructor, but somewhat more self-documenting.
Definition at line 282 of file SymbolicExpression.h.
References Type().
|
inlinestatic |
Create a new integer type.
This is an integer type whose size is specified in bits. Whether an integer is signed is determined by the context in which it's used. For instance, unsigned less-than operation will interpret its arguments as unsigned integers, whereas a signed less-than operation will interpret its arguments as 2's complement signed integers.
Definition at line 291 of file SymbolicExpression.h.
|
inlinestatic |
Create a new memory type.
A memory type has an address width and a value width. The value width is the size of the value stored at each address.
Definition at line 298 of file SymbolicExpression.h.
References Type(), addressWidth(), and MEMORY.
|
inlinestatic |
Create a new floating-point type.
A floating point type describes an IEEE-754 style of value and is parameterized by two properties: the width of the exponent field, and the width of the significand field including the implied bit. The actual storage size of the floating point value is the sum of these two widths since although the implied bit is not stored, a sign bit is stored. Due to limitations of SMT-LIB, ROSE's symbolic layer doesn't handle all IEEE-754 floating-point types. In particular, the symbolic layer supports only binary formats and uses the implied bit convention for the integer part of the significand. Gradual underflow capability (i.e., denormalized significands) is assumed.
Definition at line 310 of file SymbolicExpression.h.
References Type(), exponentWidth(), FP, and significandWidth().
|
inline |
Check whether this object is valid.
A default constructed type is invalid.
Definition at line 317 of file SymbolicExpression.h.
References INVALID, and typeClass().
|
inline |
Property: Type class.
The type class specifies whether this is an integer type, a floating-point type, or a memory type.
Definition at line 324 of file SymbolicExpression.h.
Referenced by Type(), addressWidth(), exponentWidth(), Rose::BinaryAnalysis::SymbolicExpression::Node::isFloatingPointExpr(), Rose::BinaryAnalysis::SymbolicExpression::Leaf::isFloatingPointVariable(), Rose::BinaryAnalysis::SymbolicExpression::Node::isIntegerExpr(), Rose::BinaryAnalysis::SymbolicExpression::Leaf::isIntegerVariable(), Rose::BinaryAnalysis::SymbolicExpression::Node::isMemoryExpr(), Rose::BinaryAnalysis::SymbolicExpression::Leaf::isMemoryVariable(), Rose::BinaryAnalysis::SymbolicExpression::Node::isScalar(), isValid(), and significandWidth().
|
inline |
Property: Total width of values.
This is the total width in bits of the values represented by this type. For memory types, it's the width of the value stored at each address.
Definition at line 332 of file SymbolicExpression.h.
Referenced by Rose::BinaryAnalysis::SymbolicExpressionParser::Token::Token(), Type(), integer(), Rose::BinaryAnalysis::SymbolicExpression::Node::nBits(), and significandWidth().
|
inline |
Property: Width of memory addresses.
Returns the width in bits of each memory address for a memory type. This should only be invoked on types for which typeClass returns MEMORY.
Definition at line 340 of file SymbolicExpression.h.
References MEMORY, and typeClass().
Referenced by Rose::BinaryAnalysis::SymbolicExpression::Node::domainWidth(), and memory().
|
inline |
Property: Exponent width.
Returns the width in bits of the exponent for floating-point types. This should only be invoked on types for which typeClass returns FP.
Definition at line 349 of file SymbolicExpression.h.
References FP, and typeClass().
Referenced by floatingPoint(), and significandWidth().
|
inline |
Property: Significand width.
Returns the logical width in bits of the significand for floating-point types, which includes the implied bit. The actual storage size of the significand is one bit fewer. This should only be invoked on types for which typeClass returns FP.
Definition at line 359 of file SymbolicExpression.h.
References exponentWidth(), FP, nBits(), and typeClass().
Referenced by floatingPoint().
|
inline |
Type equality.
Types are equivalent if they have the same class and sizes.
Definition at line 370 of file SymbolicExpression.h.
|
inline |
Type equality.
Types are equivalent if they have the same class and sizes.
Definition at line 373 of file SymbolicExpression.h.