clang 18.0.0git
Classes | Public Member Functions | List of all members
clang::interp::InterpStack Class Referencefinal

Stack frame storing temporaries and parameters. More...

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/Interp/InterpStack.h"

Public Member Functions

 InterpStack ()
 
 ~InterpStack ()
 Destroys the stack, freeing up storage.
 
template<typename T , typename... Tys>
void push (Tys &&... Args)
 Constructs a value in place on the top of the stack.
 
template<typename T >
pop ()
 Returns the value from the top of the stack and removes it.
 
template<typename T >
void discard ()
 Discards the top value from the stack.
 
template<typename T >
T & peek () const
 Returns a reference to the value on the top of the stack.
 
template<typename T >
T & peek (size_t Offset) const
 
void * top () const
 Returns a pointer to the top object.
 
size_t size () const
 Returns the size of the stack in bytes.
 
void clear ()
 Clears the stack without calling any destructors.
 
bool empty () const
 Returns whether the stack is empty.
 
void dump () const
 dump the stack contents to stderr.
 

Detailed Description

Stack frame storing temporaries and parameters.

Definition at line 25 of file InterpStack.h.

Constructor & Destructor Documentation

◆ InterpStack()

clang::interp::InterpStack::InterpStack ( )
inline

Definition at line 27 of file InterpStack.h.

◆ ~InterpStack()

InterpStack::~InterpStack ( )

Destroys the stack, freeing up storage.

Definition at line 19 of file InterpStack.cpp.

References clear().

Member Function Documentation

◆ clear()

void InterpStack::clear ( )

Clears the stack without calling any destructors.

Definition at line 23 of file InterpStack.cpp.

Referenced by clang::interp::Context::evaluateAsInitializer(), clang::interp::Context::evaluateAsRValue(), and ~InterpStack().

◆ discard()

template<typename T >
void clang::interp::InterpStack::discard ( )
inline

Discards the top value from the stack.

Definition at line 55 of file InterpStack.h.

Referenced by clang::interp::InterpFrame::popArgs().

◆ dump()

void InterpStack::dump ( ) const

dump the stack contents to stderr.

Definition at line 86 of file InterpStack.cpp.

References clang::interp::align(), clang::interp::primSize(), size(), TYPE_SWITCH, and V.

◆ empty()

bool clang::interp::InterpStack::empty ( ) const
inline

◆ peek() [1/2]

template<typename T >
T & clang::interp::InterpStack::peek ( ) const
inline

Returns a reference to the value on the top of the stack.

Definition at line 67 of file InterpStack.h.

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

◆ peek() [2/2]

template<typename T >
T & clang::interp::InterpStack::peek ( size_t  Offset) const
inline

Definition at line 75 of file InterpStack.h.

References clang::interp::aligned().

◆ pop()

template<typename T >
T clang::interp::InterpStack::pop ( )
inline

Returns the value from the top of the stack and removes it.

Definition at line 41 of file InterpStack.h.

Referenced by clang::interp::EvalEmitter::jumpFalse(), and clang::interp::EvalEmitter::jumpTrue().

◆ push()

template<typename T , typename... Tys>
void clang::interp::InterpStack::push ( Tys &&...  Args)
inline

Constructs a value in place on the top of the stack.

Definition at line 33 of file InterpStack.h.

◆ size()

size_t clang::interp::InterpStack::size ( ) const
inline

Returns the size of the stack in bytes.

Definition at line 84 of file InterpStack.h.

Referenced by dump().

◆ top()

void * clang::interp::InterpStack::top ( ) const
inline

Returns a pointer to the top object.

Definition at line 81 of file InterpStack.h.


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