class InterpFrame

Declaration

class InterpFrame : public Frame { /* full declaration omitted */ };

Description

Frame storing local variables.

Declared at: clang/lib/AST/Interp/InterpFrame.h:29

Inherits from: Frame

Member Variables

public clang::interp::InterpFrame* Caller
The frame of the previous function.
private clang::interp::InterpState& S
Reference to the interpreter state.
private clang::interp::Function* Func
Reference to the function being executed.
private clang::interp::Pointer This
Current object pointer for methods.
private clang::interp::CodePtr RetPC
Return address.
private const unsigned int ArgSize
The size of all the arguments.
private char* Args = nullptr
Pointer to the arguments in the callee's frame.
private std::unique_ptr<char[]> Locals
Fixed, initial storage for known local variables.
private const size_t FrameOffset
Offset on the stack at entry.
private llvm::DenseMap<unsigned int, std::unique_ptr<char[]>> Params
Mapping from arg offsets to their argument blocks.

Method Overview

  • public InterpFrame(clang::interp::InterpState & S, clang::interp::Function * Func, clang::interp::InterpFrame * Caller, clang::interp::CodePtr RetPC, clang::interp::Pointer && This)
  • public void describe(llvm::raw_ostream & OS)
  • public void destroy(unsigned int Idx)
  • public clang::SourceLocation getCallLocation() const
  • public const clang::FunctionDecl * getCallee() const
  • public clang::interp::Frame * getCaller() const
  • public const clang::Expr * getExpr(clang::interp::CodePtr PC) const
  • public size_t getFrameOffset() const
  • public clang::interp::Function * getFunction() const
  • public template <typename T>const T & getLocal(unsigned int Offset)
  • public clang::interp::Pointer getLocalPointer(unsigned int Offset)
  • public clang::SourceLocation getLocation(clang::interp::CodePtr PC) const
  • public clang::interp::CodePtr getPC() const
  • public template <typename T>const T & getParam(unsigned int Offset)
  • public clang::interp::Pointer getParamPointer(unsigned int Offset)
  • public clang::interp::CodePtr getRetPC() const
  • public virtual clang::interp::SourceInfo getSource(clang::interp::CodePtr PC) const
  • public const clang::interp::Pointer & getThis() const
  • public bool isRoot() const
  • private void * localBlock(unsigned int Offset)
  • private template <typename T>T & localRef(unsigned int Offset)
  • public void popArgs()
  • public template <typename T>void setLocal(unsigned int Offset, const T & Value)
  • public template <typename T>void setParam(unsigned int Offset, const T & Value)
  • private template <typename T>const T & stackRef(unsigned int Offset)
  • public ~InterpFrame()

Inherited from Frame:

Methods

InterpFrame(clang::interp::InterpState& S,
            clang::interp::Function* Func,
            clang::interp::InterpFrame* Caller,
            clang::interp::CodePtr RetPC,
            clang::interp::Pointer&& This)

Description

Creates a new frame for a method call.

Declared at: clang/lib/AST/Interp/InterpFrame.h:35

Parameters

clang::interp::InterpState& S
clang::interp::Function* Func
clang::interp::InterpFrame* Caller
clang::interp::CodePtr RetPC
clang::interp::Pointer&& This

void describe(llvm::raw_ostream& OS)

Description

Describes the frame with arguments for diagnostic purposes.

Declared at: clang/lib/AST/Interp/InterpFrame.h:48

Parameters

llvm::raw_ostream& OS

void destroy(unsigned int Idx)

Description

Invokes the destructors for a scope.

Declared at: clang/lib/AST/Interp/InterpFrame.h:42

Parameters

unsigned int Idx

clang::SourceLocation getCallLocation() const

Description

Returns the location of the call to the frame.

Declared at: clang/lib/AST/Interp/InterpFrame.h:54

const clang::FunctionDecl* getCallee() const

Description

Returns the caller.

Declared at: clang/lib/AST/Interp/InterpFrame.h:57

clang::interp::Frame* getCaller() const

Description

Returns the parent frame object.

Declared at: clang/lib/AST/Interp/InterpFrame.h:51

const clang::Expr* getExpr(
    clang::interp::CodePtr PC) const

Declared at: clang/lib/AST/Interp/InterpFrame.h:110

Parameters

clang::interp::CodePtr PC

size_t getFrameOffset() const

Description

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

Declared at: clang/lib/AST/Interp/InterpFrame.h:63

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

Description

Returns the current function.

Declared at: clang/lib/AST/Interp/InterpFrame.h:60

template <typename T>
const T& getLocal(unsigned int Offset)

Description

Returns the value of a local variable.

Declared at: clang/lib/AST/Interp/InterpFrame.h:66

Templates

T

Parameters

unsigned int Offset

clang::interp::Pointer getLocalPointer(
    unsigned int Offset)

Description

Returns a pointer to a local variables.

Declared at: clang/lib/AST/Interp/InterpFrame.h:76

Parameters

unsigned int Offset

clang::SourceLocation getLocation(
    clang::interp::CodePtr PC) const

Declared at: clang/lib/AST/Interp/InterpFrame.h:111

Parameters

clang::interp::CodePtr PC

clang::interp::CodePtr getPC() const

Description

Returns the PC of the frame's code start.

Declared at: clang/lib/AST/Interp/InterpFrame.h:103

template <typename T>
const T& getParam(unsigned int Offset)

Description

Returns the value of an argument.

Declared at: clang/lib/AST/Interp/InterpFrame.h:79

Templates

T

Parameters

unsigned int Offset

clang::interp::Pointer getParamPointer(
    unsigned int Offset)

Description

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

Declared at: clang/lib/AST/Interp/InterpFrame.h:94

Parameters

unsigned int Offset

clang::interp::CodePtr getRetPC() const

Description

Returns the return address of the frame.

Declared at: clang/lib/AST/Interp/InterpFrame.h:106

virtual clang::interp::SourceInfo getSource(
    clang::interp::CodePtr PC) const

Description

Map a location to a source.

Declared at: clang/lib/AST/Interp/InterpFrame.h:109

Parameters

clang::interp::CodePtr PC

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

Description

Returns the 'this' pointer.

Declared at: clang/lib/AST/Interp/InterpFrame.h:97

bool isRoot() const

Description

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

Declared at: clang/lib/AST/Interp/InterpFrame.h:100

void* localBlock(unsigned int Offset)

Description

Returns a pointer to a local's block.

Declared at: clang/lib/AST/Interp/InterpFrame.h:125

Parameters

unsigned int Offset

template <typename T>
T& localRef(unsigned int Offset)

Description

Returns an offset to a local.

Declared at: clang/lib/AST/Interp/InterpFrame.h:120

Templates

T

Parameters

unsigned int Offset

void popArgs()

Description

Pops the arguments off the stack.

Declared at: clang/lib/AST/Interp/InterpFrame.h:45

template <typename T>
void setLocal(unsigned int Offset, const T& Value)

Description

Mutates a local variable.

Declared at: clang/lib/AST/Interp/InterpFrame.h:71

Templates

T

Parameters

unsigned int Offset
const T& Value

template <typename T>
void setParam(unsigned int Offset, const T& Value)

Description

Mutates a local copy of a parameter.

Declared at: clang/lib/AST/Interp/InterpFrame.h:89

Templates

T

Parameters

unsigned int Offset
const T& Value

template <typename T>
const T& stackRef(unsigned int Offset)

Description

Returns an original argument from the stack.

Declared at: clang/lib/AST/Interp/InterpFrame.h:115

Templates

T

Parameters

unsigned int Offset

~InterpFrame()

Description

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

Declared at: clang/lib/AST/Interp/InterpFrame.h:39