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;
74 const bool IsConst =
false;
76 const bool IsMutable =
false;
93 bool IsTemporary,
bool IsMutable);
100 bool IsTemporary,
bool IsMutable);
116 return dyn_cast_or_null<ValueDecl>(
asDecl());
120 return dyn_cast_or_null<FieldDecl>(
asDecl());
124 return dyn_cast_or_null<RecordDecl>(
asDecl());
194 static constexpr uint64_t PER_FIELD =
sizeof(T) *
CHAR_BIT;
207 bool isInitialized(
unsigned I);
210 static InitMap *allocate(
unsigned N);
214 unsigned UninitFields;
unsigned IsMutable
Flag indicating if the field is mutable (if in a record).
unsigned llvm::PointerUnion< const Decl *, const Expr * > DeclTy
A (possibly-)qualified type.
bool isPrimitive() const
Checks if the descriptor is of a primitive.
unsigned getElemSize() const
returns the size of an element when the structure is viewed as an array.
unsigned IsActive
Flag indicating if the field is the active member of a union.
Decl - This represents one declaration (or definition), e.g.
bool isPrimitiveArray() const
Checks if the descriptor is of an array of primitives.
The base class of the type hierarchy.
Descriptor(const DeclTy &D, PrimType Type, bool IsConst, bool IsTemporary, bool IsMutable)
Allocates a descriptor for a primitive.
const FieldDecl * asFieldDecl() const
Represents a struct/union/class.
Represents a member of a struct/union/class.
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.
const Decl * asDecl() const
Token to denote structures of unknown size.
Structure/Class descriptor.
Inline descriptor embedded in structures and arrays.
PrimType
Enumeration of the primitive types of the VM.
unsigned getSize() const
Returns the size of the object without metadata.
const ValueDecl * asValueDecl() const
Describes a memory block created by an allocation site.
const RecordDecl * asRecordDecl() const
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
This represents one expression.
bool isZeroSizeArray() const
Checks if the descriptor is of an array of zero size.
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 IsTemporary
Flag indicating if the block is a temporary.
bool isArray() const
Checks if the descriptor is of an array.
const BlockCtorFn CtorFn
Storage management methods.
unsigned IsConst
Flag indicating if the storage is constant or not.
Encodes a location in the source.
unsigned getAllocSize() const
Returns the allocated size, including metadata.
const bool IsArray
Flag indicating if the block is an array.
void(*)(Block *Storage, char *FieldPtr, Descriptor *FieldDesc) BlockDtorFn
Invoked when a block is destroyed.
const Expr * asExpr() const
SourceLocation getLocation() const
Dataflow Directional Tag Classes.
void(*)(Block *Storage, char *FieldPtr, bool IsConst, bool IsMutable, bool IsActive, Descriptor *FieldDesc) BlockCtorFn
Invoked whenever a block is created.
unsigned InterpSize
Object size as used by the interpreter.
bool isUnknownSizeArray() const
Checks if the descriptor is of an array of unknown size.
Record *const ElemRecord
Pointer to the record, if block contains records.
unsigned getNumElems() const
Returns the number of elements stored in the block.
void initialize(TemplateInstantiationCallbackPtrs &Callbacks, const Sema &TheSema)
Descriptor *const ElemDesc
Descriptor of the array element.
unsigned Offset
Offset inside the structure/array.