Represents the size of a MemoryLocation.
Synopsis
Declared in <llvm/Analysis/MemoryLocation.h>
class LocationSize;
Description
Logically, this is an std::optional<uint63_t> that also records whether the stored size N is precise. A precise size means the referenced storage is exactly N bytes. An imprecise size is an upper bound formed by unioning precise sizes and may conservatively over‐approximate the accessed range.
For example, (%p, 4) is precise for store i32 0, i32* %p because %p must refer to at least four bytes. The same size is imprecise at a memcpy whose length is select i1 %foo, i64 1, i64 4 because at most four bytes are copied but the actual amount is unknown.
Pathologically large values degrade to std::nullopt. Bit 62 of the internal representation records scalable size information needed for alias analysis on scalable quantities.
Member Functions
Name |
Description |
Return the stored size as a TypeSize. |
|
Return true if this size has a known numeric value. |
|
Return true if this size is precise (and therefore not unknown). |
|
Return true if this size is scalable. |
|
Return true if this LocationSize's value is zero. |
|
Whether accesses before the base pointer are possible. |
|
Print a human‐readable representation of this size to |
|
Return an opaque value that represents this LocationSize. |
|
Return a LocationSize that can correctly represent either |
|
Equality operators |
|
Inequality operators |
Static Member Functions
Name |
Description |
Any location after the base pointer (but still within the underlying object). |
|
Any location before or after the base pointer (but still within the underlying object). |
|
Sentinel value used as the DenseMap empty key. |
|
Sentinel value used as the DenseMap tombstone key. |
|
|
|
|
Created with MrDocs