13#ifndef LLVM_CLANG_AST_INTERP_BLOCK_H
14#define LLVM_CLANG_AST_INTERP_BLOCK_H
21#include "llvm/ADT/PointerUnion.h"
22#include "llvm/Support/raw_ostream.h"
90 char *
rawData() {
return reinterpret_cast<char *
>(
this) +
sizeof(
Block); }
92 return reinterpret_cast<const char *
>(
this) +
sizeof(
Block);
97 T &
deref() {
return *
reinterpret_cast<T *
>(
data()); }
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
A memory block, either on the stack or in the heap.
unsigned getSize() const
Returns the size of the block.
bool IsExtern
Flag indicating if the block is an extern.
void movePointer(Pointer *From, Pointer *To)
void addPointer(Pointer *P)
Descriptor * getDescriptor() const
Returns the block's descriptor.
bool isExtern() const
Checks if the block is extern.
Block(Descriptor *Desc, bool IsStatic=false, bool IsExtern=false)
Descriptor * Desc
Pointer to the stack slot descriptor.
void removePointer(Pointer *P)
void invokeCtor()
Invokes the constructor.
bool isStatic() const
Checks if the block has static storage duration.
const char * rawData() const
const char * data() const
bool isTemporary() const
Checks if the block is temporary.
T & deref()
Returns a view over the data.
bool IsStatic
Flag indicating if the block has static storage duration.
Pointer * Pointers
Start of the chain of pointers.
Block(const std::optional< unsigned > &DeclID, Descriptor *Desc, bool IsStatic=false, bool IsExtern=false)
Block(Descriptor *Desc, bool IsExtern, bool IsStatic, bool IsDead)
bool IsDead
Flag indicating if the pointer is dead.
char * rawData()
Returns a pointer to the raw data, including metadata.
std::optional< unsigned > DeclID
Unique identifier of the declaration.
std::optional< unsigned > getDeclID() const
Returns the declaration ID.
char * data()
Returns a pointer to the stored data.
bool hasPointers() const
Checks if the block has any live pointers.
Descriptor for a dead block.
char * data()
Returns a pointer to the stored data.
A pointer to a memory block, live or dead.
PrimType
Enumeration of the primitive types of the VM.
Describes a memory block created by an allocation site.
const bool IsConst
Flag indicating if the block is mutable.
unsigned getAllocSize() const
Returns the allocated size, including metadata.
const BlockCtorFn CtorFn
Storage management methods.
unsigned getMetadataSize() const
Returns the size of the metadata.
const bool IsMutable
Flag indicating if a field is mutable.
const bool IsTemporary
Flag indicating if the block is a temporary.