My Project
|
Partial data-type information mapped to a specific range of bytes. More...
#include <varmap.hh>
Public Types | |
enum | RangeType { fixed = 0, open = 1, endpoint = 2 } |
The basic categorization of the range. More... | |
Public Member Functions | |
RangeHint (void) | |
Uninitialized constructor. | |
RangeHint (uintb st, int4 sz, intb sst, Datatype *ct, uint4 fl, RangeType rt, int4 hi) | |
Initialized constructor. | |
bool | reconcile (const RangeHint *b) const |
Can the given intersecting RangeHint coexist with this at their given offsets. More... | |
bool | contain (const RangeHint *b) const |
Return true if this or the given range contains the other. More... | |
bool | preferred (const RangeHint *b, bool reconcile) const |
Return true if the this range's data-type is preferred over the other given range. More... | |
bool | absorb (RangeHint *b) |
Try to absorb the other RangeHint into this. More... | |
bool | merge (RangeHint *b, AddrSpace *space, TypeFactory *typeFactory) |
Try to form the union of this with another RangeHint. More... | |
int4 | compare (const RangeHint &op2) const |
Order this with another RangeHint. More... | |
Static Public Member Functions | |
static bool | compareRanges (const RangeHint *a, const RangeHint *b) |
Compare two RangeHint pointers. | |
Friends | |
class | MapState |
class | ScopeLocal |
Partial data-type information mapped to a specific range of bytes.
This object gives a hint about the data-type for a sequence of bytes starting at a specific address offset (typically on the stack). It describes where the data-type starts, what data-type it might be, and how far it extends from the start point (possibly as an array).
enum RangeHint::RangeType |
bool RangeHint::absorb | ( | RangeHint * | b | ) |
Try to absorb the other RangeHint into this.
If this RangeHint is an array and the following details line up, adjust this so that it absorbs the other given RangeHint and return true. The second RangeHint:
b | is the other RangeHint to absorb |
int4 RangeHint::compare | ( | const RangeHint & | op2 | ) | const |
bool RangeHint::contain | ( | const RangeHint * | b | ) | const |
Return true if this or the given range contains the other.
We assume this range starts at least as early as the given range and that the two ranges intersect.
b | is the given range to check for containment with this |
bool RangeHint::merge | ( | RangeHint * | b, |
AddrSpace * | space, | ||
TypeFactory * | typeFactory | ||
) |
Try to form the union of this with another RangeHint.
Given that this and the other RangeHint intersect, redefine this so that it becomes the union of the two original ranges. The union must succeed in some form. An attempt is made to preserve the data-type information of both the original ranges, but changes will be made if necessary. An exception is thrown if the data-types are locked and cannot be reconciled.
b | is the other RangeHint to merge with this |
space | is the address space holding the ranges |
typeFactory | is a factory for producing data-types |
bool RangeHint::preferred | ( | const RangeHint * | b, |
bool | reconcile | ||
) | const |
Return true if the this range's data-type is preferred over the other given range.
A locked data-type is preferred over unlocked. A fixed size over open size. Otherwise data-type ordering is used.
b | is the other given range |
reconcile | is true is the two ranges have reconciled data-types |
bool RangeHint::reconcile | ( | const RangeHint * | b | ) | const |
Can the given intersecting RangeHint coexist with this at their given offsets.
Determine if the data-type information in the two ranges line up properly, in which case the union of the two ranges can exist without destroying data-type information.
b | is the range to reconcile with this |