class InterpStack

Declaration

class InterpStack { /* full declaration omitted */ };

Description

Stack frame storing temporaries and parameters.

Declared at: clang/lib/AST/Interp/InterpStack.h:22

Member Variables

private clang::interp::InterpStack::StackChunk* Chunk = nullptr
First chunk on the stack.
private size_t StackSize = 0
Total size of the stack.
private static const size_t ChunkSize = 1024 * 1024
Allocate stack space in 1Mb chunks.

Method Overview

  • public InterpStack()
  • private template <typename T>constexpr size_t aligned_size() const
  • public void clear()
  • public template <typename T>void discard()
  • private void * grow(size_t Size)
  • private void * peek(size_t Size)
  • public template <typename T>T & peek()
  • public template <typename T>T pop()
  • public template <typename T, typename... Tys>void push(Tys &&... Args)
  • private void shrink(size_t Size)
  • public size_t size() const
  • public void * top()
  • public ~InterpStack()

Methods

InterpStack()

Declared at: clang/lib/AST/Interp/InterpStack.h:24

template <typename T>
constexpr size_t aligned_size() const

Description

All stack slots are aligned to the native pointer alignment for storage. The size of an object is rounded up to a pointer alignment multiple.

Declared at: clang/lib/AST/Interp/InterpStack.h:67

Templates

T

void clear()

Description

Clears the stack without calling any destructors.

Declared at: clang/lib/AST/Interp/InterpStack.h:62

template <typename T>
void discard()

Description

Discards the top value from the stack.

Declared at: clang/lib/AST/Interp/InterpStack.h:44

Templates

T

void* grow(size_t Size)

Description

Grows the stack to accommodate a value and returns a pointer to it.

Declared at: clang/lib/AST/Interp/InterpStack.h:73

Parameters

size_t Size

void* peek(size_t Size)

Description

Returns a pointer from the top of the stack.

Declared at: clang/lib/AST/Interp/InterpStack.h:75

Parameters

size_t Size

template <typename T>
T& peek()

Description

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

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

Templates

T

template <typename T>
T pop()

Description

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

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

Templates

T

template <typename T, typename... Tys>
void push(Tys&&... Args)

Description

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

Declared at: clang/lib/AST/Interp/InterpStack.h:30

Templates

T
Tys

Parameters

Tys&&... Args

void shrink(size_t Size)

Description

Shrinks the stack.

Declared at: clang/lib/AST/Interp/InterpStack.h:77

Parameters

size_t Size

size_t size() const

Description

Returns the size of the stack in bytes.

Declared at: clang/lib/AST/Interp/InterpStack.h:59

void* top()

Description

Returns a pointer to the top object.

Declared at: clang/lib/AST/Interp/InterpStack.h:56

~InterpStack()

Description

Destroys the stack, freeing up storage.

Declared at: clang/lib/AST/Interp/InterpStack.h:27