clang
16.0.0git
|
Frame storing local variables. More...
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/Interp/InterpFrame.h"
Public Member Functions | |
InterpFrame (InterpState &S, Function *Func, InterpFrame *Caller, CodePtr RetPC, Pointer &&This) | |
Creates a new frame for a method call. More... | |
~InterpFrame () | |
Destroys the frame, killing all live pointers to stack slots. More... | |
void | destroy (unsigned Idx) |
Invokes the destructors for a scope. More... | |
void | popArgs () |
Pops the arguments off the stack. More... | |
void | describe (llvm::raw_ostream &OS) override |
Describes the frame with arguments for diagnostic purposes. More... | |
Frame * | getCaller () const override |
Returns the parent frame object. More... | |
SourceLocation | getCallLocation () const override |
Returns the location of the call to the frame. More... | |
const FunctionDecl * | getCallee () const override |
Returns the caller. More... | |
Function * | getFunction () const |
Returns the current function. More... | |
size_t | getFrameOffset () const |
Returns the offset on the stack at which the frame starts. More... | |
template<typename T > | |
const T & | getLocal (unsigned Offset) |
Returns the value of a local variable. More... | |
template<typename T > | |
void | setLocal (unsigned Offset, const T &Value) |
Mutates a local variable. More... | |
Pointer | getLocalPointer (unsigned Offset) |
Returns a pointer to a local variables. More... | |
template<typename T > | |
const T & | getParam (unsigned Offset) |
Returns the value of an argument. More... | |
template<typename T > | |
void | setParam (unsigned Offset, const T &Value) |
Mutates a local copy of a parameter. More... | |
Pointer | getParamPointer (unsigned Offset) |
Returns a pointer to an argument - lazily creates a block. More... | |
const Pointer & | getThis () const |
Returns the 'this' pointer. More... | |
bool | isRoot () const |
Checks if the frame is a root frame - return should quit the interpreter. More... | |
CodePtr | getPC () const |
Returns the PC of the frame's code start. More... | |
CodePtr | getRetPC () const |
Returns the return address of the frame. More... | |
virtual SourceInfo | getSource (CodePtr PC) const |
Map a location to a source. More... | |
const Expr * | getExpr (CodePtr PC) const |
SourceLocation | getLocation (CodePtr PC) const |
![]() | |
virtual | ~Frame () |
Public Attributes | |
InterpFrame * | Caller |
The frame of the previous function. More... | |
Frame storing local variables.
Definition at line 29 of file InterpFrame.h.
InterpFrame::InterpFrame | ( | InterpState & | S, |
Function * | Func, | ||
InterpFrame * | Caller, | ||
CodePtr | RetPC, | ||
Pointer && | This | ||
) |
Creates a new frame for a method call.
Definition at line 20 of file InterpFrame.cpp.
InterpFrame::~InterpFrame | ( | ) |
Destroys the frame, killing all live pointers to stack slots.
Definition at line 38 of file InterpFrame.cpp.
References clang::interp::Function::isConstructor(), and clang::interp::This().
|
overridevirtual |
Describes the frame with arguments for diagnostic purposes.
Implements clang::interp::Frame.
Definition at line 112 of file InterpFrame.cpp.
References getCallee(), print(), and clang::interp::This().
void InterpFrame::destroy | ( | unsigned | Idx | ) |
Invokes the destructors for a scope.
Definition at line 45 of file InterpFrame.cpp.
References clang::interp::Function::getScope(), and clang::interp::Scope::locals().
|
overridevirtual |
Returns the caller.
Implements clang::interp::Frame.
Definition at line 151 of file InterpFrame.cpp.
References clang::interp::Function::getDecl().
Referenced by describe().
|
overridevirtual |
Returns the parent frame object.
Implements clang::interp::Frame.
Definition at line 139 of file InterpFrame.cpp.
References Caller.
|
overridevirtual |
Returns the location of the call to the frame.
Implements clang::interp::Frame.
Definition at line 145 of file InterpFrame.cpp.
References Caller.
Definition at line 186 of file InterpFrame.cpp.
|
inline |
Returns the offset on the stack at which the frame starts.
Definition at line 63 of file InterpFrame.h.
|
inline |
Returns the current function.
Definition at line 60 of file InterpFrame.h.
|
inline |
Returns the value of a local variable.
Definition at line 66 of file InterpFrame.h.
References Offset.
Returns a pointer to a local variables.
Definition at line 155 of file InterpFrame.cpp.
SourceLocation InterpFrame::getLocation | ( | CodePtr | PC | ) | const |
Definition at line 190 of file InterpFrame.cpp.
|
inline |
Returns the value of an argument.
Definition at line 79 of file InterpFrame.h.
References clang::interp::Pointer::deref(), and Offset.
Returns a pointer to an argument - lazily creates a block.
Definition at line 161 of file InterpFrame.cpp.
References clang::interp::Function::getParamDescriptor(), Pointer, and TYPE_SWITCH.
Referenced by setParam().
|
inline |
Returns the PC of the frame's code start.
Definition at line 103 of file InterpFrame.h.
References clang::interp::Function::getCodeBegin().
|
inline |
Returns the return address of the frame.
Definition at line 106 of file InterpFrame.h.
|
virtual |
Map a location to a source.
Definition at line 182 of file InterpFrame.cpp.
|
inline |
Returns the 'this' pointer.
Definition at line 97 of file InterpFrame.h.
|
inline |
Checks if the frame is a root frame - return should quit the interpreter.
Definition at line 100 of file InterpFrame.h.
void InterpFrame::popArgs | ( | ) |
Pops the arguments off the stack.
Definition at line 51 of file InterpFrame.cpp.
References clang::interp::Function::args_reverse(), and TYPE_SWITCH.
|
inline |
|
inline |
Mutates a local copy of a parameter.
Definition at line 89 of file InterpFrame.h.
References clang::interp::Pointer::deref(), getParamPointer(), and Offset.
InterpFrame* clang::interp::InterpFrame::Caller |
The frame of the previous function.
Definition at line 32 of file InterpFrame.h.
Referenced by getCaller(), getCallLocation(), and clang::interp::InterpState::getCurrentFrame().