|
clang 22.0.0git
|
A memory block, either on the stack or in the heap. More...
#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/ByteCode/InterpBlock.h"
Public Member Functions | |
| Block (unsigned EvalID, UnsignedOrNone DeclID, const Descriptor *Desc, bool IsStatic=false, bool IsExtern=false, bool IsWeak=false, bool IsDummy=false) | |
| Creates a new block. | |
| Block (unsigned EvalID, const Descriptor *Desc, bool IsStatic=false, bool IsExtern=false, bool IsWeak=false, bool IsDummy=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 |
| bool | isDummy () const |
| bool | isDead () const |
| unsigned | getSize () const |
| Returns the size of the block. | |
| UnsignedOrNone | 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. | |
| void | movePointersTo (Block *B) |
| Move all pointers from this block to. | |
| 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 |
| template<typename T> | |
| const T & | deref () const |
| template<typename T> | |
| T & | deref () |
| void | invokeCtor () |
| Invokes the constructor. | |
| void | invokeDtor () |
| Invokes the Destructor. | |
| void | dump () const |
| void | dump (llvm::raw_ostream &OS) const |
| bool | isAccessible () const |
Friends | |
| class | Pointer |
| class | DeadBlock |
| class | InterpState |
| class | DynamicAllocator |
| class | Program |
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 44 of file InterpBlock.h.
|
inline |
Creates a new block.
Definition at line 53 of file InterpBlock.h.
Referenced by movePointersTo(), rawData(), and rawData().
|
inline |
Definition at line 63 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 100 of file InterpBlock.h.
References rawData().
Referenced by deref(), deref(), invokeCtor(), and invokeDtor().
|
inline |
Definition at line 105 of file InterpBlock.h.
References rawData().
Definition at line 123 of file InterpBlock.h.
Definition at line 120 of file InterpBlock.h.
References data(), and clang::T.
Referenced by clang::interp::GetGlobal(), clang::interp::GetGlobalUnchecked(), clang::interp::GetLocal(), and clang::interp::InterpFrame::getParam().
|
inline |
| LLVM_DUMP_METHOD void Block::dump | ( | llvm::raw_ostream & | OS | ) | const |
Definition at line 558 of file Disasm.cpp.
References isDead(), isDummy(), isDynamic(), isExtern(), isWeak(), Next, and Pointer.
|
inline |
Returns the declaration ID.
Definition at line 89 of file InterpBlock.h.
Referenced by CheckTemporary().
|
inline |
Returns the block's descriptor.
Definition at line 73 of file InterpBlock.h.
Referenced by clang::interp::CheckDummy(), clang::interp::CheckGlobalLoad(), clang::interp::CheckLocalLoad(), CheckTemporary(), clang::interp::CheckWeak(), clang::interp::Pointer::expand(), clang::interp::Free(), clang::interp::GetGlobalUnchecked(), clang::interp::interp__builtin_operator_delete(), clang::interp::Pointer::pointsToLiteral(), clang::interp::Pointer::pointsToStringLiteral(), clang::interp::RunDestructors(), and clang::interp::MemberPointer::toPointer().
|
inline |
The Evaluation ID this block was created in.
Definition at line 94 of file InterpBlock.h.
Referenced by clang::interp::CheckMutable(), and CheckTemporary().
|
inline |
Returns the size of the block.
Definition at line 87 of file InterpBlock.h.
Referenced by clang::interp::InterpState::deallocate(), clang::interp::getField(), clang::interp::Pointer::print(), and clang::interp::MemberPointer::toPointer().
|
inline |
Checks if the block has any live pointers.
Definition at line 75 of file InterpBlock.h.
Referenced by clang::interp::DynamicAllocator::cleanup(), clang::interp::DynamicAllocator::deallocate(), clang::interp::InterpState::deallocate(), and movePointersTo().
|
inline |
Invokes the constructor.
Definition at line 126 of file InterpBlock.h.
|
inline |
Invokes the Destructor.
Definition at line 138 of file InterpBlock.h.
References data().
Referenced by clang::interp::DynamicAllocator::cleanup(), clang::interp::DynamicAllocator::deallocate(), clang::interp::InterpState::deallocate(), clang::interp::Compiler< Emitter >::visitDecl(), clang::interp::Compiler< Emitter >::visitDeclAndReturn(), and clang::interp::EvalEmitter::~EvalEmitter().
|
inline |
Definition at line 148 of file InterpBlock.h.
Referenced by clang::interp::CheckFinalLoad(), clang::interp::CheckGlobalLoad(), clang::interp::CheckLoad(), clang::interp::CheckNewTypeMismatch(), and clang::interp::CheckStore().
|
inline |
Definition at line 85 of file InterpBlock.h.
Referenced by clang::interp::DynamicAllocator::cleanup(), clang::interp::DynamicAllocator::deallocate(), clang::interp::InterpState::deallocate(), and dump().
|
inline |
Definition at line 84 of file InterpBlock.h.
Referenced by clang::interp::CheckDummy(), dump(), and clang::interp::Program::dump().
|
inline |
Definition at line 83 of file InterpBlock.h.
Referenced by clang::interp::InterpState::deallocate(), dump(), and clang::interp::interp__builtin_operator_delete().
|
inline |
Checks if the block is extern.
Definition at line 77 of file InterpBlock.h.
Referenced by clang::interp::CheckGlobalLoad(), clang::interp::CheckLocalLoad(), clang::interp::Program::createGlobal(), dump(), and clang::interp::GetGlobalUnchecked().
|
inline |
Returns whether the data of this block has been initialized via invoking the Ctor func.
Definition at line 92 of file InterpBlock.h.
Referenced by clang::interp::DynamicAllocator::cleanup(), clang::interp::DynamicAllocator::deallocate(), clang::interp::InterpState::deallocate(), clang::interp::EvalEmitter::~EvalEmitter(), and clang::interp::Program::~Program().
|
inline |
Checks if the block has static storage duration.
Definition at line 79 of file InterpBlock.h.
Referenced by clang::interp::CheckDestructor(), CheckTemporary(), and clang::interp::InterpState::deallocate().
|
inline |
Checks if the block is temporary.
Definition at line 81 of file InterpBlock.h.
Referenced by CheckTemporary().
|
inline |
Definition at line 82 of file InterpBlock.h.
Referenced by clang::interp::CheckWeak(), and dump().
| void Block::movePointersTo | ( | Block * | B | ) |
Move all pointers from this block to.
| B. |
Definition at line 103 of file InterpBlock.cpp.
References Block(), clang::interp::Pointer::BS, hasPointers(), clang::interp::BlockPointer::Pointee, and Pointer.
Referenced by clang::interp::Program::createGlobal().
|
inline |
Returns a pointer to the raw data, including metadata.
You are allowed to read Desc->getAllocSize() bytes from this address.
Definition at line 113 of file InterpBlock.h.
References Block().
Referenced by clang::interp::Pointer::allElementsInitialized(), clang::interp::CheckGlobalLoad(), clang::interp::CheckLocalLoad(), data(), data(), clang::interp::InterpState::deallocate(), clang::interp::GetGlobalUnchecked(), clang::interp::Pointer::initialize(), invokeCtor(), clang::interp::Pointer::isElementInitialized(), clang::interp::Pointer::isInitialized(), clang::interp::Compiler< Emitter >::visitDecl(), and clang::interp::Compiler< Emitter >::visitDeclAndReturn().
|
inline |
Definition at line 116 of file InterpBlock.h.
References Block().
|
friend |
|
friend |
Definition at line 154 of file InterpBlock.h.
References DynamicAllocator.
Referenced by DynamicAllocator.
|
friend |
|
friend |
Definition at line 151 of file InterpBlock.h.
References Pointer.
Referenced by dump(), movePointersTo(), and Pointer.
|
friend |