clang  10.0.0svn
Public Member Functions | Public Attributes | List of all members
clang::interp::InterpFrame Class Referencefinal

Frame storing local variables. More...

#include "/opt/doxygen-docs/src/llvm/tools/clang/lib/AST/Interp/InterpFrame.h"

Inheritance diagram for clang::interp::InterpFrame:
Inheritance graph
[legend]
Collaboration diagram for clang::interp::InterpFrame:
Collaboration graph
[legend]

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)
 Describes the frame with arguments for diagnostic purposes. More...
 
FramegetCaller () const
 Returns the parent frame object. More...
 
SourceLocation getCallLocation () const
 Returns the location of the call to the frame. More...
 
const FunctionDeclgetCallee () const
 Returns the caller. More...
 
FunctiongetFunction () 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 PointergetThis () 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 ExprgetExpr (CodePtr PC) const
 
SourceLocation getLocation (CodePtr PC) const
 
- Public Member Functions inherited from clang::interp::Frame
virtual ~Frame ()
 

Public Attributes

InterpFrameCaller
 The frame of the previous function. More...
 

Detailed Description

Frame storing local variables.

Definition at line 29 of file InterpFrame.h.

Constructor & Destructor Documentation

◆ InterpFrame()

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::~InterpFrame ( )

Destroys the frame, killing all live pointers to stack slots.

Definition at line 38 of file InterpFrame.cpp.

References clang::interp::InterpState::deallocate(), clang::interp::Pointer::initialize(), clang::interp::Pointer::isBaseClass(), and clang::interp::Function::isConstructor().

Member Function Documentation

◆ describe()

void InterpFrame::describe ( llvm::raw_ostream &  OS)
virtual

◆ destroy()

void InterpFrame::destroy ( unsigned  Idx)

Invokes the destructors for a scope.

Definition at line 45 of file InterpFrame.cpp.

References clang::interp::InterpState::deallocate(), clang::interp::Function::getScope(), and clang::interp::Scope::locals().

Referenced by clang::interp::Destroy().

◆ getCallee()

const FunctionDecl * InterpFrame::getCallee ( ) const
virtual

Returns the caller.

Implements clang::interp::Frame.

Definition at line 151 of file InterpFrame.cpp.

References clang::interp::Function::getDecl().

Referenced by describe(), and clang::interp::NoRet().

◆ getCaller()

Frame * InterpFrame::getCaller ( ) const
virtual

Returns the parent frame object.

Implements clang::interp::Frame.

Definition at line 139 of file InterpFrame.cpp.

References Caller, and clang::interp::InterpState::getSplitFrame().

◆ getCallLocation()

SourceLocation InterpFrame::getCallLocation ( ) const
virtual

Returns the location of the call to the frame.

Implements clang::interp::Frame.

Definition at line 145 of file InterpFrame.cpp.

References Caller, and clang::interp::SourceMapper::getLocation().

◆ getExpr()

const Expr * InterpFrame::getExpr ( CodePtr  PC) const

◆ getFrameOffset()

size_t clang::interp::InterpFrame::getFrameOffset ( ) const
inline

Returns the offset on the stack at which the frame starts.

Definition at line 63 of file InterpFrame.h.

◆ getFunction()

Function* clang::interp::InterpFrame::getFunction ( ) const
inline

Returns the current function.

Definition at line 60 of file InterpFrame.h.

◆ getLocal()

template<typename T >
const T& clang::interp::InterpFrame::getLocal ( unsigned  Offset)
inline

Returns the value of a local variable.

Definition at line 66 of file InterpFrame.h.

References Offset.

Referenced by clang::interp::GetLocal().

◆ getLocalPointer()

Pointer InterpFrame::getLocalPointer ( unsigned  Offset)

Returns a pointer to a local variables.

Definition at line 155 of file InterpFrame.cpp.

Referenced by clang::interp::GetPtrLocal(), and setLocal().

◆ getLocation()

SourceLocation InterpFrame::getLocation ( CodePtr  PC) const

Definition at line 190 of file InterpFrame.cpp.

References clang::interp::SourceMapper::getLocation().

Referenced by getRetPC().

◆ getParam()

template<typename T >
const T& clang::interp::InterpFrame::getParam ( unsigned  Offset)
inline

Returns the value of an argument.

Definition at line 79 of file InterpFrame.h.

References clang::interp::Pointer::deref(), and Offset.

Referenced by clang::interp::GetParam().

◆ getParamPointer()

Pointer InterpFrame::getParamPointer ( unsigned  Offset)

Returns a pointer to an argument - lazily creates a block.

Definition at line 161 of file InterpFrame.cpp.

References clang::interp::Function::getParamDescriptor(), and TYPE_SWITCH.

Referenced by clang::interp::GetPtrParam(), and setParam().

◆ getPC()

CodePtr clang::interp::InterpFrame::getPC ( ) const
inline

Returns the PC of the frame's code start.

Definition at line 103 of file InterpFrame.h.

References clang::interp::Function::getCodeBegin().

◆ getRetPC()

CodePtr clang::interp::InterpFrame::getRetPC ( ) const
inline

Returns the return address of the frame.

Definition at line 106 of file InterpFrame.h.

References getExpr(), getLocation(), getSource(), and Offset.

◆ getSource()

SourceInfo InterpFrame::getSource ( CodePtr  PC) const
virtual

Map a location to a source.

Definition at line 182 of file InterpFrame.cpp.

References clang::interp::InterpState::getSource().

Referenced by getRetPC(), clang::interp::Shl(), and clang::interp::Shr().

◆ getThis()

const Pointer& clang::interp::InterpFrame::getThis ( ) const
inline

◆ isRoot()

bool clang::interp::InterpFrame::isRoot ( ) const
inline

Checks if the frame is a root frame - return should quit the interpreter.

Definition at line 100 of file InterpFrame.h.

◆ popArgs()

void InterpFrame::popArgs ( )

◆ setLocal()

template<typename T >
void clang::interp::InterpFrame::setLocal ( unsigned  Offset,
const T &  Value 
)
inline

Mutates a local variable.

Definition at line 71 of file InterpFrame.h.

References getLocalPointer(), and Offset.

Referenced by clang::interp::SetLocal().

◆ setParam()

template<typename T >
void clang::interp::InterpFrame::setParam ( unsigned  Offset,
const T &  Value 
)
inline

Mutates a local copy of a parameter.

Definition at line 89 of file InterpFrame.h.

References clang::interp::Pointer::deref(), and getParamPointer().

Referenced by clang::interp::SetParam().

Member Data Documentation

◆ Caller

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().


The documentation for this class was generated from the following files: