class EHScopeStack

Declaration

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

Description

A stack of scopes which respond to exceptions, including cleanups and catch blocks.

Declared at: clang/lib/CodeGen/EHScopeStack.h:94

Member Variables

private char* StartOfBuffer
The start of the scope-stack buffer, i.e. the allocated pointer for the buffer. All of these pointers are either simultaneously null or simultaneously valid.
private char* EndOfBuffer
The end of the buffer.
private char* StartOfData
The first valid entry in the buffer.
private clang::CodeGen::EHScopeStack::stable_iterator InnermostNormalCleanup
The innermost normal cleanup on the stack.
private clang::CodeGen::EHScopeStack::stable_iterator InnermostEHScope
The innermost EH scope on the stack.
private clang::CodeGen::CodeGenFunction* CGF
The CGF this Stack belong to
private SmallVector<clang::CodeGen::BranchFixup, 8> BranchFixups
Note that branches are allowed to jump into protected scopes in certain situations; e.g. the following code is legal: struct A { ~A(); }; // trivial ctor, non-trivial dtor goto foo; A a; foo: bar();

Method Overview

Methods

EHScopeStack()

Declared at: clang/lib/CodeGen/EHScopeStack.h:269

clang::CodeGen::BranchFixup& addBranchFixup()

Description

Add a branch fixup to the current cleanup scope.

Declared at: clang/lib/CodeGen/EHScopeStack.h:401

char* allocate(size_t Size)

Declared at: clang/lib/CodeGen/EHScopeStack.h:263

Parameters

size_t Size

clang::CodeGen::EHScopeStack::iterator begin()
    const

Description

Returns an iterator pointing to the innermost EH scope.

Declared at: clang/lib/CodeGen/EHScopeStack.h:376

void clearFixups()

Description

Clears the branch-fixups list. This should only be called by ResolveAllBranchFixups.

Declared at: clang/lib/CodeGen/EHScopeStack.h:420

bool containsOnlyLifetimeMarkers(
    clang::CodeGen::EHScopeStack::stable_iterator
        Old) const

Declared at: clang/lib/CodeGen/EHScopeStack.h:347

Parameters

clang::CodeGen::EHScopeStack::stable_iterator Old

void deallocate(size_t Size)

Declared at: clang/lib/CodeGen/EHScopeStack.h:264

Parameters

size_t Size

bool empty() const

Description

Determines whether the exception-scopes stack is empty.

Declared at: clang/lib/CodeGen/EHScopeStack.h:350

clang::CodeGen::EHScopeStack::iterator end() const

Description

Returns an iterator pointing to the outermost EH scope.

Declared at: clang/lib/CodeGen/EHScopeStack.h:379

clang::CodeGen::EHScopeStack::iterator find(
    clang::CodeGen::EHScopeStack::stable_iterator
        save) const

Description

Turn a stable reference to a scope depth into a unstable pointer to the EH stack.

Declared at: clang/lib/CodeGen/EHScopeStack.h:398

Parameters

clang::CodeGen::EHScopeStack::stable_iterator save

clang::CodeGen::BranchFixup& getBranchFixup(
    unsigned int I)

Declared at: clang/lib/CodeGen/EHScopeStack.h:408

Parameters

unsigned int I

clang::CodeGen::EHScopeStack::stable_iterator
getInnermostActiveNormalCleanup() const

Declared at: clang/lib/CodeGen/EHScopeStack.h:364

clang::CodeGen::EHScopeStack::stable_iterator
getInnermostEHScope() const

Declared at: clang/lib/CodeGen/EHScopeStack.h:366

clang::CodeGen::EHScopeStack::stable_iterator
getInnermostNormalCleanup() const

Description

Returns the innermost normal cleanup on the stack, or stable_end() if there are no normal cleanups.

Declared at: clang/lib/CodeGen/EHScopeStack.h:361

unsigned int getNumBranchFixups() const

Declared at: clang/lib/CodeGen/EHScopeStack.h:407

bool hasNormalCleanups() const

Description

Determines whether there are any normal cleanups on the stack.

Declared at: clang/lib/CodeGen/EHScopeStack.h:355

void popCatch()

Description

Pops a catch scope off the stack. This is private to CGException.cpp.

Declared at: clang/lib/CodeGen/EHScopeStack.h:331

void popCleanup()

Description

Pops a cleanup scope off the stack. This is private to CGCleanup.cpp.

Declared at: clang/lib/CodeGen/EHScopeStack.h:323

void popFilter()

Description

Pops an exceptions filter off the stack.

Declared at: clang/lib/CodeGen/EHScopeStack.h:337

void popNullFixups()

Description

Pops lazily-removed fixups from the end of the list. This should only be called by procedures which have just popped a cleanup or resolved one or more fixups.

Declared at: clang/lib/CodeGen/EHScopeStack.h:416

void popTerminate()

Description

Pops a terminate handler off the stack.

Declared at: clang/lib/CodeGen/EHScopeStack.h:343

class EHCatchScope* pushCatch(
    unsigned int NumHandlers)

Description

Push a set of catch handlers on the stack. The catch is uninitialized and will need to have the given number of handlers set on it.

Declared at: clang/lib/CodeGen/EHScopeStack.h:328

Parameters

unsigned int NumHandlers

template <class T, class... As>
void pushCleanup(clang::CodeGen::CleanupKind Kind,
                 As... A)

Description

Push a lazily-created cleanup on the stack.

Declared at: clang/lib/CodeGen/EHScopeStack.h:276

Templates

T
As

Parameters

clang::CodeGen::CleanupKind Kind
As... A

void* pushCleanup(clang::CodeGen::CleanupKind K,
                  size_t DataSize)

Declared at: clang/lib/CodeGen/EHScopeStack.h:266

Parameters

clang::CodeGen::CleanupKind K
size_t DataSize

template <class T, class... As>
void pushCleanupTuple(
    clang::CodeGen::CleanupKind Kind,
    std::tuple<As...> A)

Description

Push a lazily-created cleanup on the stack. Tuple version.

Declared at: clang/lib/CodeGen/EHScopeStack.h:286

Templates

T
As

Parameters

clang::CodeGen::CleanupKind Kind
std::tuple<As...> A

template <class T, class... As>
T* pushCleanupWithExtra(
    clang::CodeGen::CleanupKind Kind,
    size_t N,
    As... A)

Description

Push a cleanup with non-constant storage requirements on the stack. The cleanup type must provide an additional static method: static size_t getExtraSize(size_t); The argument to this method will be the value N, which will also be passed as the first argument to the constructor. The data stored in the extra storage must obey the same restrictions as normal cleanup member data. The pointer returned from this method is valid until the cleanup stack is modified.

Declared at: clang/lib/CodeGen/EHScopeStack.h:308

Templates

T
As

Parameters

clang::CodeGen::CleanupKind Kind
size_t N
As... A

void pushCopyOfCleanup(
    clang::CodeGen::CleanupKind Kind,
    const void* Cleanup,
    size_t Size)

Declared at: clang/lib/CodeGen/EHScopeStack.h:315

Parameters

clang::CodeGen::CleanupKind Kind
const void* Cleanup
size_t Size

class EHFilterScope* pushFilter(
    unsigned int NumFilters)

Description

Push an exceptions filter on the stack.

Declared at: clang/lib/CodeGen/EHScopeStack.h:334

Parameters

unsigned int NumFilters

void pushTerminate()

Description

Push a terminate handler on the stack.

Declared at: clang/lib/CodeGen/EHScopeStack.h:340

bool requiresLandingPad() const

Declared at: clang/lib/CodeGen/EHScopeStack.h:352

void setCGF(
    clang::CodeGen::CodeGenFunction* inCGF)

Declared at: clang/lib/CodeGen/EHScopeStack.h:320

Parameters

clang::CodeGen::CodeGenFunction* inCGF

clang::CodeGen::EHScopeStack::stable_iterator
stabilize(clang::CodeGen::EHScopeStack::iterator
              it) const

Description

Translates an iterator into a stable_iterator.

Declared at: clang/lib/CodeGen/EHScopeStack.h:394

Parameters

clang::CodeGen::EHScopeStack::iterator it

clang::CodeGen::EHScopeStack::stable_iterator
stable_begin() const

Description

Create a stable reference to the top of the EH stack. The returned reference is valid until that scope is popped off the stack.

Declared at: clang/lib/CodeGen/EHScopeStack.h:384

static clang::CodeGen::EHScopeStack::
    stable_iterator
    stable_end()

Description

Create a stable reference to the bottom of the EH stack.

Declared at: clang/lib/CodeGen/EHScopeStack.h:389

~EHScopeStack()

Declared at: clang/lib/CodeGen/EHScopeStack.h:273