LLDB mainline
lldb_private::PolicyStack Class Reference

Per-thread policy stack. More...

#include <Policy.h>

Classes

class  Guard
 RAII guard that pushes a policy on construction and pops on destruction. More...

Public Member Functions

Policy Current () const
void Push (Policy policy)
void Pop ()
void Dump (Stream &s) const

Static Public Member Functions

static PolicyStackGet ()

Private Attributes

llvm::SmallVector< Policym_stack = {Policy{}}

Detailed Description

Per-thread policy stack.

The stack lives in thread_local storage. Each thread has its own stack, initialized with a default-constructed base entry that is never popped. RAII guards (Guard) push and pop policies.

For thread pool workers that don't inherit thread_local storage, the policy must be passed into the lambda and pushed onto the worker thread's stack when the task starts.

Definition at line 85 of file Policy.h.

Member Function Documentation

◆ Current()

◆ Dump()

void PolicyStack::Dump ( Stream & s) const

Definition at line 39 of file Policy.cpp.

References m_stack, and lldb_private::Stream::Printf().

◆ Get()

◆ Pop()

void lldb_private::PolicyStack::Pop ( )
inline

Definition at line 96 of file Policy.h.

References m_stack.

Referenced by lldb_private::PolicyStack::Guard::~Guard().

◆ Push()

void lldb_private::PolicyStack::Push ( Policy policy)
inline

Definition at line 94 of file Policy.h.

References m_stack.

Referenced by lldb_private::PolicyStack::Guard::Guard().

Member Data Documentation

◆ m_stack

llvm::SmallVector<Policy> lldb_private::PolicyStack::m_stack = {Policy{}}
private

Definition at line 114 of file Policy.h.

Referenced by Current(), Dump(), Pop(), and Push().


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