14 using namespace clang;
22 : Pointee(
P.Pointee),
Base(
P.
Base), Offset(
P.Offset) {
28 : Pointee(Pointee),
Base(
Base), Offset(Offset) {
29 assert((
Base == RootPtrMark ||
Base %
alignof(
void *) == 0) &&
"wrong base");
83 Base =
static_cast<const Expr *
>(
nullptr);
92 else if (
auto *E = Desc->
asExpr())
95 llvm_unreachable(
"Invalid allocation type");
101 IsOnePastEnd =
false;
115 bool IsVirtual =
false;
119 if (
auto *BaseOrMember = Desc->
asDecl()) {
124 llvm_unreachable(
"Invalid field type");
132 return APValue(Base, Offset, Path, IsOnePastEnd, IsNullPtr);
136 assert(Pointee &&
"Cannot check if null pointer was initialized");
155 assert(Pointee &&
"Cannot initialize null pointer");
172 assert(
Base != 0 &&
"Only composite fields can be initialised");
179 assert(
Base != 0 &&
"Only composite fields can be initialised");
188 return A.Pointee == B.Pointee;
static LValuePathEntry ArrayIndex(uint64_t Index)
void initialize() const
Initializes a field.
unsigned IsActive
Flag indicating if the field is the active member of a union.
bool isPrimitiveArray() const
Checks if the descriptor is of an array of primitives.
void activate() const
Activats a field.
A pointer to a memory block, live or dead.
Bitfield tracking the initialisation status of elements of primitive arrays.
unsigned IsInitialized
For primitive fields, it indicates if the field was initialized.
A memory block, either on the stack or in the heap.
void movePointer(Pointer *From, Pointer *To)
static CharUnits Zero()
Zero - Construct a CharUnits quantity of zero.
const Decl * asDecl() const
CharUnits - This is an opaque type for sizes expressed in character units.
bool isInitialized(unsigned I)
Checks if an element was initialized.
const ValueDecl * asValueDecl() const
void operator=(const Pointer &P)
static bool hasSameBase(const Pointer &A, const Pointer &B)
Checks if two pointers are comparable.
Describes a memory block created by an allocation site.
void removePointer(Pointer *P)
This represents one expression.
A non-discriminated union of a base, field, or array index.
bool isField() const
Checks if the item is a field in an object.
void deactivate() const
Deactivates an entire strurcutre.
bool isArrayElement() const
Checks if the pointer points to an array.
const bool IsArray
Flag indicating if the block is an array.
Descriptor * getFieldDesc() const
Accessors for information about the innermost field.
bool IsStatic
Flag indicating if the block has static storage duration.
const Expr * asExpr() const
static bool hasSameArray(const Pointer &A, const Pointer &B)
Checks if two pointers can be subtracted.
bool initialize(unsigned I)
Initializes an element. Returns true when object if fully initialized.
static InitMap * allocate(unsigned N)
Allocates a map holding N elements.
Dataflow Directional Tag Classes.
Pointer getArray() const
Returns the parent array.
bool isInitialized() const
Checks if an object was initialized.
bool isUnknownSizeArray() const
Checks if the structure is an array of unknown size.
int64_t getIndex() const
Returns the index into an array.
bool isOnePastEnd() const
Checks if the index is one past end.
bool isZero() const
Checks if the pointer is null.
Descriptor * getDeclDesc() const
Accessor for information about the declaration site.
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
unsigned getNumElems() const
Returns the number of elements stored in the block.
void addPointer(Pointer *P)
APValue toAPValue() const
Converts the pointer to an APValue.
Pointer getBase() const
Returns a pointer to the object of which this pointer is a field.