|
clang 24.0.0git
|
Frame storing local variables. More...
#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/ByteCode/InterpFrame.h"
Public Member Functions | |
| InterpFrame (InterpState &S) | |
| Bottom Frame. | |
| InterpFrame (InterpState &S, const Function *Func, InterpFrame *Caller, CodePtr RetPC, unsigned ArgSize) | |
| Creates a new frame for a method call. | |
| InterpFrame (InterpState &S, const Function *Func, CodePtr RetPC, unsigned VarArgSize=0) | |
| Creates a new frame with the values that make sense. | |
| ~InterpFrame () | |
| Destroys the frame, killing all live pointers to stack slots. | |
| std::string | getName () const |
| void | destroy (unsigned Idx) |
| Invokes the destructors for a scope. | |
| void | enableLocal (unsigned Offset) |
| bool | isLocalEnabled (unsigned Offset) const |
| void | describe (llvm::raw_ostream &OS) const override |
| Describes the frame with arguments for diagnostic purposes. | |
| Frame * | getCaller () const override |
| Returns the parent frame object. | |
| SourceRange | getCallRange () const override |
| Returns the location of the call to the frame. | |
| const FunctionDecl * | getCallee () const override |
| Returns the caller. | |
| const Function * | getFunction () const |
| Returns the current function. | |
| size_t | getFrameOffset () const |
| Returns the offset on the stack at which the frame starts. | |
| template<typename T> | |
| const T & | getLocal (unsigned Offset) const |
| Returns the value of a local variable. | |
| template<typename T> | |
| void | setLocal (unsigned Offset, const T &Value) |
| Mutates a local variable. | |
| Pointer | getLocalPointer (unsigned Offset) const |
| Returns a pointer to a local variables. | |
| Block * | getLocalBlock (unsigned Offset) const |
| template<typename T> | |
| const T & | getParam (unsigned Index) const |
| Returns the value of an argument. | |
| template<typename T> | |
| void | setParam (unsigned Index, const T &Value) |
| Mutates a local copy of a parameter. | |
| Pointer | getParamPointer (unsigned Offset) |
| Returns a pointer to an argument - lazily creates a block. | |
| bool | hasThisPointer () const |
| const Pointer & | getThis () const |
| Returns the 'this' pointer. | |
| const Pointer & | getRVOPtr () const |
| Returns the RVO pointer, if the Function has one. | |
| CodePtr | getRetPC () const |
| CodePtr | getRetOpPC () const |
| Returns the return address of the opcode in the caller frame. | |
| SourceInfo | getSource (CodePtr PC) const |
| Map a location to a source. | |
| const Expr * | getExpr (CodePtr PC) const |
| SourceLocation | getLocation (CodePtr PC) const |
| SourceRange | getRange (CodePtr PC) const |
| unsigned | getArgSize () const |
| bool | isStdFunction () const |
| bool | isBottomFrame () const |
| void | dump () const |
| void | dump (llvm::raw_ostream &OS, unsigned Indent=0) const |
| Public Member Functions inherited from clang::interp::Frame | |
| virtual | ~Frame ()=default |
Static Public Member Functions | |
| static size_t | allocSize (const Function *F) |
| Returns the number of bytes needed to allocate an InterpFrame for the given function. | |
Public Attributes | |
| InterpFrame * | Caller |
| The frame of the previous function. | |
| unsigned | MSVCConstexprAllowed = 0 |
Frame storing local variables.
Definition at line 27 of file InterpFrame.h.
| InterpFrame::InterpFrame | ( | InterpState & | S | ) |
Bottom Frame.
Definition at line 25 of file InterpFrame.cpp.
References Caller, and clang::nullptr.
Referenced by allocSize(), dump(), getCallRange(), InterpFrame(), and InterpFrame().
| InterpFrame::InterpFrame | ( | InterpState & | S, |
| const Function * | Func, | ||
| InterpFrame * | Caller, | ||
| CodePtr | RetPC, | ||
| unsigned | ArgSize ) |
Creates a new frame for a method call.
Definition at line 29 of file InterpFrame.cpp.
References clang::interp::Block, Caller, InterpFrame(), clang::interp::Block::Local, Local, clang::interp::Scope::locals(), and clang::interp::Block::None.
| InterpFrame::InterpFrame | ( | InterpState & | S, |
| const Function * | Func, | ||
| CodePtr | RetPC, | ||
| unsigned | VarArgSize = 0 ) |
Creates a new frame with the values that make sense.
I.e., the caller is the current frame of S, the This() pointer is the current Pointer on the top of S's stack, and the RVO pointer is before that.
Definition at line 59 of file InterpFrame.cpp.
References getArgSize(), and InterpFrame().
| InterpFrame::~InterpFrame | ( | ) |
Destroys the frame, killing all live pointers to stack slots.
Definition at line 70 of file InterpFrame.cpp.
References clang::interp::Block::isInitialized(), Local, and clang::interp::Scope::locals().
Returns the number of bytes needed to allocate an InterpFrame for the given function.
Definition at line 48 of file InterpFrame.h.
References clang::interp::Function::getArgSize(), clang::interp::Function::getFrameSize(), clang::interp::Function::getNumWrittenParams(), and InterpFrame().
Referenced by clang::interp::InterpState::allocFrame(), clang::interp::InterpState::exitFrame(), and clang::interp::TrivialCopy().
|
overridevirtual |
Describes the frame with arguments for diagnostic purposes.
Implements clang::interp::Frame.
Definition at line 136 of file InterpFrame.cpp.
References clang::interp::align(), Caller, clang::ASTContext::getCanonicalTagType(), clang::ASTContext::getLValueReferenceType(), clang::FunctionDecl::getNameForDiagnostic(), clang::ASTContext::getPrintingPolicy(), getRetOpPC(), getThis(), clang::isa(), clang::Off, clang::FunctionDecl::parameters(), clang::interp::primSize(), print(), clang::interp::PT_Ptr, shouldSkipInBacktrace(), clang::PrintingPolicy::SuppressLambdaBody, and TYPE_SWITCH.
Referenced by dump().
| void InterpFrame::destroy | ( | unsigned | Idx | ) |
Invokes the destructors for a scope.
Definition at line 95 of file InterpFrame.cpp.
References clang::interp::Block::isInitialized(), and Local.
|
inline |
| LLVM_DUMP_METHOD void InterpFrame::dump | ( | llvm::raw_ostream & | OS, |
| unsigned | Indent = 0 ) const |
Definition at line 532 of file Disasm.cpp.
References Caller, describe(), clang::ast_matchers::getCallee(), getFunction(), getRVOPtr(), getThis(), hasThisPointer(), clang::Indent(), and InterpFrame().
| void InterpFrame::enableLocal | ( | unsigned | Offset | ) |
Definition at line 90 of file InterpFrame.cpp.
References clang::interp::Block::getBlockDesc(), and getLocalBlock().
Referenced by clang::interp::EnableLocal().
|
inline |
Definition at line 167 of file InterpFrame.h.
Referenced by clang::interp::cleanupAfterFunctionCall(), and InterpFrame().
|
overridevirtual |
Returns the caller.
Implements clang::interp::Frame.
Definition at line 218 of file InterpFrame.cpp.
Referenced by clang::interp::interp__builtin_is_within_lifetime(), and clang::interp::NoRet().
|
inlineoverridevirtual |
Returns the parent frame object.
Implements clang::interp::Frame.
Definition at line 72 of file InterpFrame.h.
References Caller.
|
overridevirtual |
Returns the location of the call to the frame.
Implements clang::interp::Frame.
Definition at line 198 of file InterpFrame.cpp.
References clang::C, Caller, InterpFrame(), and clang::SourceRange::isValid().
Definition at line 161 of file InterpFrame.h.
References clang::interp::SourceInfo::asExpr(), and getSource().
Referenced by clang::interp::AddSubMulHelper(), clang::interp::CallVirt(), clang::interp::CastFloatingIntegral(), clang::interp::CheckBitCast(), clang::interp::CheckBitCast(), checkBitcastType(), clang::interp::CheckDivRem(), clang::interp::CheckLiteralType(), clang::interp::CheckThis(), clang::interp::diagnoseShiftFailure(), clang::interp::DiagTypeid(), clang::interp::DoBitCastPtr(), clang::interp::DynamicCast(), clang::interp::GetTypeidPtr(), clang::interp::handleFixedPointOverflow(), clang::interp::handleOverflow(), clang::interp::IncDecHelper(), clang::interp::interp__builtin_is_constant_evaluated(), clang::interp::InvalidCast(), clang::interp::Neg(), clang::interp::PtrPtrCast(), clang::interp::ShiftFixedPoint(), and clang::interp::SizelessVectorElementSize().
|
inline |
Returns the offset on the stack at which the frame starts.
Definition at line 85 of file InterpFrame.h.
Referenced by clang::interp::Ret(), and clang::interp::RetVoid().
|
inline |
Returns the current function.
Definition at line 81 of file InterpFrame.h.
Referenced by clang::interp::Call(), clang::interp::CallVar(), clang::interp::CheckLiteralType(), clang::interp::cleanupAfterFunctionCall(), clang::interp::Destroy(), dump(), clang::interp::GetTypeidPtr(), clang::interp::Interpret(), clang::interp::Ret(), clang::interp::RetVoid(), clang::interp::runRecordDestructor(), clang::interp::RVOPtr(), and clang::interp::This().
Returns the value of a local variable.
Definition at line 89 of file InterpFrame.h.
References clang::T.
Definition at line 108 of file InterpFrame.h.
References clang::interp::Block::invokeCtor(), and clang::interp::Block::isInitialized().
Referenced by clang::interp::Destroy(), enableLocal(), clang::interp::GetLocal(), getLocalPointer(), clang::interp::GetRefLocal(), isLocalEnabled(), and setLocal().
Returns a pointer to a local variables.
Definition at line 104 of file InterpFrame.h.
References getLocalBlock(), and Pointer.
Referenced by clang::interp::Destroy(), and clang::interp::GetPtrLocal().
|
inline |
Definition at line 162 of file InterpFrame.h.
References clang::interp::SourceInfo::getLoc(), and getSource().
Referenced by clang::interp::Assume(), clang::interp::CheckCallable(), clang::interp::CheckConstant(), clang::interp::checkConstructor(), CheckGlobal(), clang::interp::CheckGlobalLoad(), clang::interp::CheckLoad(), clang::interp::CheckLocalLoad(), clang::interp::CheckNewTypeMismatch(), clang::interp::CheckNonNullArg(), clang::interp::CheckNonNullArgs(), clang::interp::CheckVolatile(), clang::interp::CheckWeak(), clang::interp::compileFunction(), clang::interp::diagnoseCallableDecl(), clang::interp::diagnoseEnumValue(), clang::interp::InterpretOffsetOf(), clang::interp::InvalidTargetLabel(), clang::interp::ShiftFixedPoint(), and clang::interp::Unsupported().
|
inline |
Definition at line 53 of file InterpFrame.h.
Returns the value of an argument.
Definition at line 118 of file InterpFrame.h.
References clang::interp::Block::deref(), clang::interp::Block::isInitialized(), and clang::T.
Referenced by clang::interp::GetParam().
Returns a pointer to an argument - lazily creates a block.
Definition at line 224 of file InterpFrame.cpp.
References clang::interp::Block::data(), clang::interp::Block::getDescriptor(), clang::interp::Descriptor::getPrimType(), clang::interp::Block::invokeCtor(), isBottomFrame(), clang::interp::Block::isInitialized(), clang::interp::Descriptor::isPrimitive(), Pointer, clang::T, and TYPE_SWITCH.
Referenced by clang::interp::GetPtrParam().
|
inline |
Definition at line 165 of file InterpFrame.h.
References clang::interp::SourceInfo::getRange(), and getSource().
Referenced by clang::interp::CheckBitCast(), clang::interp::CheckFloatResult(), clang::interp::CheckLifetime(), clang::interp::CheckLive(), clang::interp::CheckLoad(), clang::interp::CheckNull(), clang::interp::CheckPointerToIntegralCast(), clang::interp::CheckRange(), clang::interp::CheckRange(), clang::interp::CheckRange(), clang::interp::CheckSubobject(), clang::interp::diagnoseUninitialized(), clang::interp::FnPtrCast(), clang::interp::InitElem(), clang::interp::InitElemPop(), clang::interp::interp__builtin_strcmp(), clang::interp::InterpretOffsetOf(), clang::interp::Invalid(), clang::interp::InvalidCast(), clang::interp::InvalidTargetLabel(), clang::interp::PtrPtrCast(), clang::interp::SizelessVectorElementSize(), and clang::interp::Unsupported().
|
inline |
Returns the return address of the opcode in the caller frame.
Definition at line 152 of file InterpFrame.h.
References clang::interp::align().
Referenced by describe(), and getSource().
|
inline |
Definition at line 150 of file InterpFrame.h.
Referenced by clang::interp::interp__builtin_is_constant_evaluated(), clang::interp::interp__builtin_is_within_lifetime(), clang::interp::Ret(), and clang::interp::RetVoid().
|
inline |
Returns the RVO pointer, if the Function has one.
Definition at line 143 of file InterpFrame.h.
References isBottomFrame().
Referenced by dump(), and clang::interp::RVOPtr().
| SourceInfo InterpFrame::getSource | ( | CodePtr | PC | ) | const |
Map a location to a source.
Definition at line 251 of file InterpFrame.cpp.
References Caller, funcHasUsableBody(), getRetOpPC(), and clang::Result.
Referenced by clang::interp::addSubOffsetOpaque(), clang::interp::AllocCN(), clang::interp::AllocN(), clang::interp::allowNullSubObj(), clang::interp::ArrayDecay(), clang::interp::BitCastPrim(), clang::interp::CallPtr(), clang::interp::CallVirt(), clang::interp::CheckActive(), clang::interp::CheckArray(), clang::interp::CheckArrayDestSize(), clang::interp::CheckArraySize(), clang::interp::CheckArraySize(), clang::interp::CheckBitCast(), checkBitcastType(), clang::interp::CheckCallDepth(), clang::interp::CheckConst(), clang::interp::CheckDeleteSource(), clang::interp::checkDestructor(), clang::interp::CheckDivRem(), clang::interp::CheckDynamicMemoryAllocation(), clang::interp::CheckFloatResult(), clang::interp::CheckFloatStatus(), clang::interp::CheckLifetime(), clang::interp::CheckLive(), clang::interp::CheckLoad(), clang::interp::CheckLoad(), clang::interp::CheckMutable(), clang::interp::CheckNewDeleteForms(), clang::interp::CheckNewTypeMismatch(), clang::interp::CheckNull(), clang::interp::CheckNull(), clang::interp::CheckPlacementNew(), clang::interp::CheckPointerToIntegralCast(), clang::interp::CheckPseudoDtor(), clang::interp::CheckRange(), clang::interp::CheckRange(), clang::interp::CheckRange(), clang::interp::CheckSubobject(), clang::interp::CheckTemporary(), clang::interp::CMP3(), clang::interp::CmpHelper< Pointer >(), clang::interp::CmpHelperEQ< MemberPointer >(), clang::interp::CmpHelperEQ< Pointer >(), clang::interp::DefaultInit(), clang::interp::diagnoseArrayIndex(), clang::interp::diagnoseDummy(), diagnoseMissingInitializer(), clang::interp::diagnoseNonConstexprBuiltin(), diagnoseNonConstVariable(), clang::interp::diagnoseShiftFailure(), clang::interp::diagnoseTypeIdField(), clang::interp::diagnoseUninitialized(), diagnoseUnknownDecl(), clang::interp::diagnoseUnreadableObject(), clang::interp::Divc(), clang::interp::DoShift(), clang::interp::DoShiftAP(), clang::interp::DynamicCast(), clang::interp::FnPtrCast(), clang::interp::Free(), clang::interp::getDynamicDecl(), getExpr(), clang::interp::GetIntPtr(), getLocation(), clang::interp::GetPtrDerivedPop(), getRange(), clang::interp::handleReference(), clang::interp::InitElem(), clang::interp::InitElemPop(), clang::interp::interp__builtin_elementwise_countzeroes(), clang::interp::interp__builtin_ia32_vcvtps2ph(), clang::interp::interp__builtin_is_within_lifetime(), clang::interp::interp__builtin_load8(), clang::interp::interp__builtin_memchr(), clang::interp::interp__builtin_memcmp(), clang::interp::interp__builtin_memcpy(), clang::interp::interp__builtin_operator_delete(), clang::interp::interp__builtin_operator_new(), clang::interp::interp__builtin_stdc_memreverse8(), clang::interp::interp__builtin_strcmp(), clang::interp::Invalid(), clang::interp::InvalidCast(), clang::interp::InvalidDeclRef(), clang::interp::InvalidNewDeleteExpr(), clang::interp::InvalidShuffleVectorIndex(), clang::interp::InvalidStore(), clang::interp::PtrPtrCast(), clang::interp::runRecordDestructor(), and clang::interp::SubPtr().
|
inline |
Returns the 'this' pointer.
Definition at line 136 of file InterpFrame.h.
References hasThisPointer(), and isBottomFrame().
Referenced by clang::interp::ActivateThisField(), clang::interp::CheckLiteralType(), describe(), dump(), clang::interp::GetPtrThisBase(), clang::interp::GetPtrThisField(), clang::interp::GetPtrThisVirtBase(), clang::interp::GetThisField(), clang::interp::InitThisBitField(), clang::interp::InitThisBitFieldActivate(), clang::interp::InitThisField(), clang::interp::InitThisFieldActivate(), clang::interp::runRecordDestructor(), clang::interp::StartThisLifetime(), clang::interp::StartThisLifetime1(), and clang::interp::This().
|
inline |
Definition at line 133 of file InterpFrame.h.
Referenced by clang::interp::ActivateThisField(), clang::interp::CheckThis(), dump(), getThis(), and clang::interp::runRecordDestructor().
|
inline |
Definition at line 171 of file InterpFrame.h.
References Caller.
Referenced by clang::interp::CheckFunctionDecl(), clang::interp::CheckLiteralType(), clang::interp::CheckLocalLoad(), clang::interp::CtorCheck(), getParamPointer(), clang::interp::GetPtrParam(), clang::interp::GetPtrThisBase(), clang::interp::GetPtrThisField(), getRVOPtr(), getThis(), clang::interp::InitThisBitField(), clang::interp::InitThisBitFieldActivate(), clang::interp::InitThisField(), clang::interp::InitThisFieldActivate(), clang::interp::Ret(), clang::interp::RetVoid(), and clang::interp::runRecordDestructor().
Definition at line 62 of file InterpFrame.h.
References clang::interp::Block::getBlockDesc(), and getLocalBlock().
Referenced by clang::interp::EnableLocal(), and clang::interp::GetLocalEnabled().
| bool InterpFrame::isStdFunction | ( | ) | const |
Definition at line 274 of file InterpFrame.cpp.
References clang::DeclContext::getParent().
Referenced by clang::interp::CheckPlacementNew().
|
inline |
Mutates a local variable.
Definition at line 94 of file InterpFrame.h.
References clang::interp::Block::deref(), clang::interp::Block::getBlockDesc(), getLocalBlock(), clang::interp::Started, and clang::T.
Referenced by clang::interp::SetLocal().
|
inline |
Mutates a local copy of a parameter.
Definition at line 126 of file InterpFrame.h.
References clang::T.
Referenced by clang::interp::SetParam().
| InterpFrame* clang::interp::InterpFrame::Caller |
The frame of the previous function.
Definition at line 222 of file InterpFrame.h.
Referenced by clang::interp::cleanupAfterFunctionCall(), describe(), dump(), getCaller(), getCallRange(), getSource(), clang::interp::interp__builtin_is_within_lifetime(), InterpFrame(), InterpFrame(), and isBottomFrame().
| unsigned clang::interp::InterpFrame::MSVCConstexprAllowed = 0 |
Definition at line 241 of file InterpFrame.h.
Referenced by clang::interp::CheckCallable(), clang::interp::CheckFunctionDecl(), clang::interp::CheckPlacementNew(), clang::interp::PopMSVCCE(), and clang::interp::PushMSVCCE().