ROSE
0.11.98.0
|
Type of symbolic expression.
Definition at line 223 of file SymbolicExpr.h.
#include <Rose/BinaryAnalysis/SymbolicExpr.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 226 of file SymbolicExpr.h.
|
inline |
Create an invalid, empty type.
This is used mainly for default arguments.
Definition at line 264 of file SymbolicExpr.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 283 of file SymbolicExpr.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 292 of file SymbolicExpr.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 299 of file SymbolicExpr.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 311 of file SymbolicExpr.h.
|
inline |
Check whether this object is valid.
A default constructed type is invalid.
Definition at line 318 of file SymbolicExpr.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 325 of file SymbolicExpr.h.
Referenced by addressWidth(), exponentWidth(), Rose::BinaryAnalysis::SymbolicExpr::Node::isFloatingPointExpr(), Rose::BinaryAnalysis::SymbolicExpr::Leaf::isFloatingPointVariable(), Rose::BinaryAnalysis::SymbolicExpr::Node::isIntegerExpr(), Rose::BinaryAnalysis::SymbolicExpr::Leaf::isIntegerVariable(), Rose::BinaryAnalysis::SymbolicExpr::Node::isMemoryExpr(), Rose::BinaryAnalysis::SymbolicExpr::Leaf::isMemoryVariable(), Rose::BinaryAnalysis::SymbolicExpr::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 333 of file SymbolicExpr.h.
Referenced by Rose::BinaryAnalysis::SymbolicExpr::Node::nBits(), significandWidth(), Rose::BinaryAnalysis::SymbolicExprParser::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 341 of file SymbolicExpr.h.
References MEMORY, and typeClass().
Referenced by Rose::BinaryAnalysis::SymbolicExpr::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 350 of file SymbolicExpr.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 360 of file SymbolicExpr.h.
References exponentWidth(), FP, nBits(), and typeClass().
|
inline |
Type equality.
Types are equivalent if they have the same class and sizes.
Definition at line 371 of file SymbolicExpr.h.
|
inline |
Type equality.
Types are equivalent if they have the same class and sizes.
Definition at line 374 of file SymbolicExpr.h.
bool Rose::BinaryAnalysis::SymbolicExpr::Type::operator< | ( | const Type & | other | ) | const |
Type comparison.
void Rose::BinaryAnalysis::SymbolicExpr::Type::print | ( | std::ostream & | , |
TypeStyle::Flag | style = TypeStyle::FULL |
||
) | const |
Print the type.
std::string Rose::BinaryAnalysis::SymbolicExpr::Type::toString | ( | TypeStyle::Flag | style = TypeStyle::FULL | ) | const |
Print the type to a string.