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"
82 const std::byte *
data()
const {
91 return reinterpret_cast<std::byte *
>(
this) +
sizeof(
Block);
94 return reinterpret_cast<const std::byte *
>(
this) +
sizeof(
Block);
99 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 addPointer(Pointer *P)
Pointer chain management.
void replacePointer(Pointer *Old, Pointer *New)
void invokeDtor()
Invokes the Destructor.
bool isExtern() const
Checks if the block is extern.
Block(Descriptor *Desc, bool IsStatic=false, bool IsExtern=false)
std::byte * data()
Returns a pointer to the stored data.
Descriptor * Desc
Pointer to the stack slot descriptor.
const Descriptor * getDescriptor() const
Returns the block's descriptor.
bool hasPointer(const Pointer *P) const
void removePointer(Pointer *P)
const std::byte * rawData() const
void invokeCtor()
Invokes the constructor.
bool isStatic() const
Checks if the block has static storage duration.
bool isTemporary() const
Checks if the block is temporary.
std::byte * rawData()
Returns a pointer to the raw data, including metadata.
const std::byte * data() const
T & deref()
Returns a view over the data.
void cleanup()
Deletes a dead block at the end of its lifetime.
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)
Creates a new block.
Block(Descriptor *Desc, bool IsExtern, bool IsStatic, bool IsDead)
bool IsDead
Flag indicating if the pointer is dead.
std::optional< unsigned > DeclID
Unique identifier of the declaration.
std::optional< unsigned > getDeclID() const
Returns the declaration ID.
bool hasPointers() const
Checks if the block has any live pointers.
Descriptor for a dead block.
std::byte * 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.