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 {
105 unsigned MDDiff =
static_cast<int>(B->MDSize) -
static_cast<int>(MDSize);
110 this->removePointer(P);
137 : Root(Root), B(~0u, Blk->Desc, Blk->MDSize, Blk->isExtern(), Blk->IsStatic,
138 Blk->isWeak(), Blk->isDummy(),
148 B.DynAllocId = Blk->DynAllocId;
151 B.Pointers = Blk->Pointers;
154 Blk->Pointers =
nullptr;
157void DeadBlock::free() {
void movePointersTo(Block *B)
Move all pointers from this block to.
Block(unsigned EvalID, UnsignedOrNone DeclID, const Descriptor *Desc, unsigned MDSize=0, 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.
void removePointers()
Make all pointers that currently point to this block point to nullptr.
DeadBlock(DeadBlock *&Root, Block *Blk)
Copies the block.
A pointer to a memory block, live or dead.
bool isBlockPointer() const
const BlockPointer & asBlockPointer() const
Top level wrappers for InstallAPI frontend operations.
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.