ROSE
0.11.131.0
|
Type of symbolic expression.
Definition at line 225 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. More... | |
bool | isValid () const |
Check whether this object is valid. More... | |
TypeClass | typeClass () const |
Property: Type class. More... | |
size_t | nBits () const |
Property: Total width of values. More... | |
size_t | addressWidth () const |
Property: Width of memory addresses. More... | |
size_t | exponentWidth () const |
Property: Exponent width. More... | |
size_t | significandWidth () const |
Property: Significand width. More... | |
bool | operator< (const Type &other) const |
Type comparison. More... | |
void | print (std::ostream &, TypeStyle::Flag style=TypeStyle::FULL) const |
Print the type. More... | |
std::string | toString (TypeStyle::Flag style=TypeStyle::FULL) const |
Print the type to a string. More... | |
bool | operator== (const Type &other) const |
Type equality. More... | |
bool | operator!= (const Type &other) const |
Type equality. More... | |
Static Public Member Functions | |
static Type | none () |
Create no type. More... | |
static Type | integer (size_t nBits) |
Create a new integer type. More... | |
static Type | memory (size_t addressWidth, size_t valueWidth) |
Create a new memory type. More... | |
static Type | floatingPoint (size_t exponentWidth, size_t significandWidth) |
Create a new floating-point type. More... | |
Type class.
Enumerator | |
---|---|
INTEGER |
Integer type. |
FP |
Floating-point type. |
MEMORY |
Memory type. |
INVALID |
Default constructed. |
Definition at line 228 of file SymbolicExpression.h.
|
inline |
Create an invalid, empty type.
This is used mainly for default arguments.
Definition at line 266 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 285 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 294 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 301 of file SymbolicExpression.h.
|
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 313 of file SymbolicExpression.h.
|
inline |
Check whether this object is valid.
A default constructed type is invalid.
Definition at line 320 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 327 of file SymbolicExpression.h.
Referenced by 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(), significandWidth(), and Type().
|
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 335 of file SymbolicExpression.h.
Referenced by Rose::BinaryAnalysis::SymbolicExpression::Node::nBits(), significandWidth(), Rose::BinaryAnalysis::SymbolicExpressionParser::Token::Token(), and Type().
|
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 343 of file SymbolicExpression.h.
References MEMORY, and typeClass().
Referenced by Rose::BinaryAnalysis::SymbolicExpression::Node::domainWidth().
|
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 352 of file SymbolicExpression.h.
References FP, and typeClass().
Referenced by 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 362 of file SymbolicExpression.h.
References exponentWidth(), FP, nBits(), and typeClass().
|
inline |
Type equality.
Types are equivalent if they have the same class and sizes.
Definition at line 373 of file SymbolicExpression.h.
|
inline |
Type equality.
Types are equivalent if they have the same class and sizes.
Definition at line 376 of file SymbolicExpression.h.
bool Rose::BinaryAnalysis::SymbolicExpression::Type::operator< | ( | const Type & | other | ) | const |
Type comparison.
void Rose::BinaryAnalysis::SymbolicExpression::Type::print | ( | std::ostream & | , |
TypeStyle::Flag | style = TypeStyle::FULL |
||
) | const |
Print the type.
std::string Rose::BinaryAnalysis::SymbolicExpression::Type::toString | ( | TypeStyle::Flag | style = TypeStyle::FULL | ) | const |
Print the type to a string.