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"
83 const std::byte *
data()
const {
92 return reinterpret_cast<std::byte *
>(
this) +
sizeof(
Block);
95 return reinterpret_cast<const std::byte *
>(
this) +
sizeof(
Block);
101 template <
typename T>
const T &
deref()
const {
102 return *
reinterpret_cast<const T *
>(
data());
122 void dump(llvm::raw_ostream &OS)
const;
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.
const Descriptor * Desc
Pointer to the stack slot descriptor.
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(const Descriptor *Desc, bool IsExtern, bool IsStatic, bool IsDead)
Block(const std::optional< unsigned > &DeclID, const Descriptor *Desc, bool IsStatic=false, bool IsExtern=false)
Creates a new block.
std::byte * data()
Returns a pointer to the stored data.
Block(const Descriptor *Desc, bool IsStatic=false, bool IsExtern=false)
const Descriptor * getDescriptor() const
Returns the block's descriptor.
bool hasPointer(const Pointer *P) const
void removePointer(Pointer *P)
const std::byte * rawData() const
bool IsInitialized
Flag indicating if the block contents have been initialized via invokeCtor.
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
bool isInitialized() 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.
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.
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
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.