20 :
Parent(
Parent), M(M),
P(
P), Stk(Stk), Ctx(Ctx), Current(nullptr) {}
31 std::free(DeadBlocks);
39 for (
DeadBlock *DB = DeadBlocks; DB; DB = DB->Next) {
41 P->PointeeStorage.BS.Pointee =
nullptr;
70 reinterpret_cast<char *
>(std::malloc(
sizeof(
DeadBlock) + Size));
71 auto *
D =
new (Memory)
DeadBlock(DeadBlocks, B);
72 std::memset(
D->B.rawData(), 0,
D->B.getSize());
75 if (B->IsInitialized && Desc->
MoveFn) {
80 D->B.IsInitialized = B->IsInitialized;
83 B->IsInitialized =
false;
84 }
else if (B->IsInitialized) {
94 assert(It.second.size() > 0);
96 const Expr *Source = It.first;
101 return NoAllocationsLeft;
This represents one expression.
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
A (possibly-)qualified type.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
The base class of the type hierarchy.
A memory block, either on the stack or in the heap.
unsigned getSize() const
Returns the size of the block.
void invokeDtor()
Invokes the Destructor.
std::byte * data()
Returns a pointer to the stored data.
const Descriptor * getDescriptor() const
Returns the block's descriptor.
std::byte * rawData()
Returns a pointer to the raw data, including metadata.
bool hasPointers() const
Checks if the block has any live pointers.
Holds all information required to evaluate constexpr code in a module.
Descriptor for a dead block.
llvm::iterator_range< const_virtual_iter > allocation_sites() const
unsigned getNumAllocations() const
Base class for stack frames, shared between VM and walker.
Frame storing local variables.
InterpFrame * Caller
The frame of the previous function.
Stack frame storing temporaries and parameters.
bool reportOverflow(const Expr *E, const llvm::APSInt &Value)
Reports overflow and return true if evaluation should continue.
bool noteUndefinedBehavior() override
Frame * getCurrentFrame() override
bool maybeDiagnoseDanglingAllocations()
Diagnose any dynamic allocations that haven't been freed yet.
InterpFrame * Current
The current frame.
InterpState(State &Parent, Program &P, InterpStack &Stk, Context &Ctx, SourceMapper *M=nullptr)
void deallocate(Block *B)
Deallocates a pointer.
bool checkingPotentialConstantExpression() const override
Program & P
Reference to the module containing all bytecode.
A pointer to a memory block, live or dead.
The program contains and links the bytecode for all functions.
Interface for classes which map locations to sources.
Interface for the VM to interact with the AST walker's context.
virtual Frame * getCurrentFrame()=0
OptionalDiagnostic CCEDiag(SourceLocation Loc, diag::kind DiagId=diag::note_invalid_subexpr_in_const_expr, unsigned ExtraNotes=0)
Diagnose that the evaluation does not produce a C++11 core constant expression.
The JSON file list parser is used to communicate input to InstallAPI.
Describes a memory block created by an allocation site.
unsigned getMetadataSize() const
Returns the size of the metadata.