Go to the documentation of this file.
13 #ifndef LLVM_CLANG_AST_INTERP_DESCRIPTOR_H
14 #define LLVM_CLANG_AST_INTERP_DESCRIPTOR_H
26 using DeclTy = llvm::PointerUnion<const Decl *, const Expr *>;
32 bool IsMutable,
bool IsActive,
63 static constexpr
unsigned UnknownSizeMark = (
unsigned)-1;
116 return dyn_cast_or_null<ValueDecl>(
asDecl());
120 return dyn_cast_or_null<FieldDecl>(
asDecl());
124 return dyn_cast_or_null<RecordDecl>(
asDecl());
214 unsigned UninitFields;
const bool IsTemporary
Flag indicating if the block is a temporary.
static InitMap * allocate(unsigned N)
Allocates a map holding N elements.
const bool IsConst
Flag indicating if the block is mutable.
bool isPrimitiveArray() const
Checks if the descriptor is of an array of primitives.
bool isZeroSizeArray() const
Checks if the descriptor is of an array of zero size.
Encodes a location in the source.
A (possibly-)qualified type.
Represents a member of a struct/union/class.
unsigned IsBase
Flag indicating if the field is an embedded base class.
void(*)(Block *Storage, char *SrcFieldPtr, char *DstFieldPtr, Descriptor *FieldDesc) BlockMoveFn
Invoked when a block with pointers referencing it goes out of scope.
const bool IsArray
Flag indicating if the block is an array.
Descriptor *const ElemDesc
Descriptor of the array element.
bool isInitialized(unsigned I)
Checks if an element was initialized.
unsigned IsConst
Flag indicating if the storage is constant or not.
unsigned getAllocSize() const
Returns the allocated size, including metadata.
The base class of the type hierarchy.
const RecordDecl * asRecordDecl() const
unsigned getNumElems() const
Returns the number of elements stored in the block.
Bitfield tracking the initialisation status of elements of primitive arrays.
Token to denote structures of unknown size.
unsigned Offset
Offset inside the structure/array.
bool isArray() const
Checks if the descriptor is of an array.
unsigned IsActive
Flag indicating if the field is the active member of a union.
unsigned IsMutable
Flag indicating if the field is mutable (if in a record).
A memory block, either on the stack or in the heap.
PrimType
Enumeration of the primitive types of the VM.
bool isPrimitive() const
Checks if the descriptor is of a primitive.
bool isUnknownSizeArray() const
Checks if the descriptor is of an array of unknown size.
void(*)(Block *Storage, char *FieldPtr, bool IsConst, bool IsMutable, bool IsActive, Descriptor *FieldDesc) BlockCtorFn
Invoked whenever a block is created.
Descriptor(const DeclTy &D, PrimType Type, bool IsConst, bool IsTemporary, bool IsMutable)
Allocates a descriptor for a primitive.
bool initialize(unsigned I)
Initializes an element. Returns true when object if fully initialized.
const ValueDecl * asValueDecl() const
Record *const ElemRecord
Pointer to the record, if block contains records.
const FieldDecl * asFieldDecl() const
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Inline descriptor embedded in structures and arrays.
Decl - This represents one declaration (or definition), e.g.
SourceLocation getLocation() const
const Decl * asDecl() const
const BlockCtorFn CtorFn
Storage management methods.
Describes a memory block created by an allocation site.
unsigned getSize() const
Returns the size of the object without metadata.
void(*)(Block *Storage, char *FieldPtr, Descriptor *FieldDesc) BlockDtorFn
Invoked when a block is destroyed.
const Expr * asExpr() const
unsigned llvm::PointerUnion< const Decl *, const Expr * > DeclTy
unsigned IsInitialized
For primitive fields, it indicates if the field was initialized.
const bool IsMutable
Flag indicating if a field is mutable.
This represents one expression.
Structure/Class descriptor.
Represents a struct/union/class.
unsigned getElemSize() const
returns the size of an element when the structure is viewed as an array.