19void Block::addPointer(
Pointer *P) {
23 assert(!hasPointer(P));
26 Pointers->BS.Prev = P;
31 assert(hasPointer(P));
35void Block::removePointer(
Pointer *P) {
40 assert(hasPointer(P));
43 BlockPointer &BP = P->
BS;
54 assert(!hasPointer(P));
58void Block::cleanup() {
60 (
reinterpret_cast<DeadBlock *
>(
this + 1) - 1)->free();
67 assert(
New->isBlockPointer());
70 assert(hasPointer(Old));
73 BlockPointer &OldBP = Old->
BS;
74 BlockPointer &NewBP =
New->BS;
88 assert(!hasPointer(Old));
89 assert(hasPointer(
New));
94bool Block::hasPointer(
const Pointer *P)
const {
106 static_cast<int>(Desc->getMetadataSize());
111 this->removePointer(P);
126 : Root(Root), B(~0u, Blk->Desc, Blk->isExtern(), Blk->IsStatic,
127 Blk->isWeak(), Blk->isDummy(),
true) {
136 B.DynAllocId = Blk->DynAllocId;
139 B.Pointers = Blk->Pointers;
142 Blk->Pointers =
nullptr;
145void DeadBlock::free() {
void movePointersTo(Block *B)
Move all pointers from this block to.
Block(unsigned EvalID, UnsignedOrNone DeclID, const Descriptor *Desc, bool IsStatic=false, bool IsExtern=false, bool IsWeak=false, bool IsDummy=false)
Creates a new block.
bool isInitialized() const
Returns whether the data of this block has been initialized via invoking the Ctor func.
bool hasPointers() const
Checks if the block has any live pointers.
DeadBlock(DeadBlock *&Root, Block *Blk)
Copies the block.
A pointer to a memory block, live or dead.
bool isBlockPointer() const
const BlockPointer & asBlockPointer() const
The JSON file list parser is used to communicate input to InstallAPI.
for(const auto &A :T->param_types())
Pointer * Prev
Previous link in the pointer chain.
Pointer * Next
Next link in the pointer chain.
unsigned Base
Start of the current subfield.
Block * Pointee
The block the pointer is pointing to.
unsigned getMetadataSize() const
Returns the size of the metadata.