clang 20.0.0git
|
A memory block, either on the stack or in the heap. More...
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/ByteCode/InterpBlock.h"
Public Member Functions | |
Block (unsigned EvalID, const std::optional< unsigned > &DeclID, const Descriptor *Desc, bool IsStatic=false, bool IsExtern=false, bool IsWeak=false) | |
Creates a new block. | |
Block (unsigned EvalID, const Descriptor *Desc, bool IsStatic=false, bool IsExtern=false, bool IsWeak=false) | |
const Descriptor * | getDescriptor () const |
Returns the block's descriptor. | |
bool | hasPointers () const |
Checks if the block has any live pointers. | |
bool | isExtern () const |
Checks if the block is extern. | |
bool | isStatic () const |
Checks if the block has static storage duration. | |
bool | isTemporary () const |
Checks if the block is temporary. | |
bool | isWeak () const |
bool | isDynamic () const |
unsigned | getSize () const |
Returns the size of the block. | |
std::optional< unsigned > | getDeclID () const |
Returns the declaration ID. | |
bool | isInitialized () const |
Returns whether the data of this block has been initialized via invoking the Ctor func. | |
unsigned | getEvalID () const |
The Evaluation ID this block was created in. | |
std::byte * | data () |
Returns a pointer to the stored data. | |
const std::byte * | data () const |
std::byte * | rawData () |
Returns a pointer to the raw data, including metadata. | |
const std::byte * | rawData () const |
void | invokeCtor () |
Invokes the constructor. | |
void | invokeDtor () |
Invokes the Destructor. | |
void | dump () const |
void | dump (llvm::raw_ostream &OS) const |
Friends | |
class | Pointer |
class | DeadBlock |
class | InterpState |
class | DynamicAllocator |
A memory block, either on the stack or in the heap.
The storage described by the block is immediately followed by optional metadata, which is followed by the actual data.
Block* rawData() data() │ │ │ │ │ │ ▼ ▼ ▼ ┌───────────────┬─────────────────────────┬─────────────────┐ │ Block │ Metadata │ Data │ │ sizeof(Block) │ Desc->getMetadataSize() │ Desc->getSize() │ └───────────────┴─────────────────────────┴─────────────────┘
Desc->getAllocSize() describes the size after the Block, i.e. the data size and the metadata size.
Definition at line 49 of file InterpBlock.h.
|
inline |
Creates a new block.
Definition at line 52 of file InterpBlock.h.
|
inline |
Definition at line 60 of file InterpBlock.h.
|
inline |
Returns a pointer to the stored data.
You are allowed to read Desc->getSize() bytes from this address.
Definition at line 91 of file InterpBlock.h.
References clang::interp::Descriptor::getMetadataSize(), and rawData().
Referenced by clang::interp::DeadBlock::data(), clang::interp::InterpState::deallocate(), invokeCtor(), and invokeDtor().
|
inline |
Definition at line 96 of file InterpBlock.h.
References clang::interp::Descriptor::getMetadataSize(), and rawData().
|
inline |
LLVM_DUMP_METHOD void Block::dump | ( | llvm::raw_ostream & | OS | ) | const |
Definition at line 336 of file Disasm.cpp.
References clang::interp::Descriptor::dump(), and P.
|
inline |
Returns the declaration ID.
Definition at line 82 of file InterpBlock.h.
Referenced by clang::interp::Pointer::getDeclID().
|
inline |
Returns the block's descriptor.
Definition at line 68 of file InterpBlock.h.
Referenced by clang::interp::InterpState::deallocate(), clang::interp::Pointer::expand(), clang::interp::Free(), clang::interp::interp__builtin_operator_delete(), clang::interp::Pointer::pointsToLiteral(), clang::interp::RunDestructors(), and clang::interp::MemberPointer::toPointer().
|
inline |
The Evaluation ID this block was created in.
Definition at line 87 of file InterpBlock.h.
Referenced by clang::interp::CheckMutable(), and CheckTemporary().
|
inline |
Returns the size of the block.
Definition at line 80 of file InterpBlock.h.
References clang::interp::Descriptor::getAllocSize().
Referenced by clang::interp::InterpState::deallocate(), clang::interp::GetPtrField(), clang::interp::GetPtrFieldPop(), clang::interp::Pointer::print(), and clang::interp::MemberPointer::toPointer().
|
inline |
Checks if the block has any live pointers.
Definition at line 70 of file InterpBlock.h.
Referenced by clang::interp::DynamicAllocator::cleanup(), and clang::interp::InterpState::deallocate().
|
inline |
Invokes the constructor.
Definition at line 112 of file InterpBlock.h.
References clang::interp::Descriptor::CtorFn, data(), clang::interp::Descriptor::getAllocSize(), clang::interp::Descriptor::IsConst, clang::interp::Descriptor::IsMutable, and rawData().
Referenced by clang::interp::DynamicAllocator::allocate(), clang::interp::EvalEmitter::createLocal(), clang::interp::InterpFrame::getParamPointer(), and clang::interp::InterpFrame::initScope().
|
inline |
Invokes the Destructor.
Definition at line 123 of file InterpBlock.h.
References data(), and clang::interp::Descriptor::DtorFn.
Referenced by clang::interp::DynamicAllocator::cleanup(), clang::interp::InterpState::deallocate(), clang::interp::DynamicAllocator::deallocate(), clang::interp::Compiler< Emitter >::visitDecl(), clang::interp::Compiler< Emitter >::visitDeclAndReturn(), and clang::interp::EvalEmitter::~EvalEmitter().
|
inline |
Definition at line 78 of file InterpBlock.h.
Referenced by clang::interp::Pointer::isDynamic().
|
inline |
Checks if the block is extern.
Definition at line 72 of file InterpBlock.h.
Referenced by clang::interp::Pointer::isExtern().
|
inline |
Returns whether the data of this block has been initialized via invoking the Ctor func.
Definition at line 85 of file InterpBlock.h.
Referenced by clang::interp::EvalEmitter::~EvalEmitter(), and clang::interp::Program::~Program().
|
inline |
Checks if the block has static storage duration.
Definition at line 74 of file InterpBlock.h.
Referenced by clang::interp::Pointer::isStatic().
|
inline |
Checks if the block is temporary.
Definition at line 76 of file InterpBlock.h.
References clang::interp::Descriptor::IsTemporary.
Referenced by clang::interp::Pointer::isTemporary().
|
inline |
Definition at line 77 of file InterpBlock.h.
Referenced by clang::interp::Pointer::isWeak().
|
inline |
Returns a pointer to the raw data, including metadata.
You are allowed to read Desc->getAllocSize() bytes from this address.
Definition at line 104 of file InterpBlock.h.
Referenced by data(), clang::interp::InterpState::deallocate(), clang::interp::Pointer::deref(), clang::interp::Pointer::initialize(), invokeCtor(), clang::interp::Pointer::isInitialized(), clang::interp::DeadBlock::rawData(), clang::interp::Compiler< Emitter >::visitDecl(), and clang::interp::Compiler< Emitter >::visitDeclAndReturn().
|
inline |
Definition at line 107 of file InterpBlock.h.
|
friend |
Definition at line 135 of file InterpBlock.h.
|
friend |
Definition at line 137 of file InterpBlock.h.
|
friend |
Definition at line 136 of file InterpBlock.h.
|
friend |
Definition at line 134 of file InterpBlock.h.