clang API Documentation

Classes | Public Member Functions | Static Public Member Functions
clang::CodeGen::EHScopeStack Class Reference

#include <EHScopeStack.h>

List of all members.

Classes

class  Cleanup
class  ConditionalCleanup1
class  ConditionalCleanup2
class  ConditionalCleanup3
class  ConditionalCleanup4
class  iterator
 A non-stable pointer into the scope stack. More...
class  stable_iterator

Public Member Functions

 EHScopeStack ()
 ~EHScopeStack ()
template<class T >
void pushCleanup (CleanupKind Kind)
 Push a lazily-created cleanup on the stack.
template<class T , class A0 >
void pushCleanup (CleanupKind Kind, A0 a0)
 Push a lazily-created cleanup on the stack.
template<class T , class A0 , class A1 >
void pushCleanup (CleanupKind Kind, A0 a0, A1 a1)
 Push a lazily-created cleanup on the stack.
template<class T , class A0 , class A1 , class A2 >
void pushCleanup (CleanupKind Kind, A0 a0, A1 a1, A2 a2)
 Push a lazily-created cleanup on the stack.
template<class T , class A0 , class A1 , class A2 , class A3 >
void pushCleanup (CleanupKind Kind, A0 a0, A1 a1, A2 a2, A3 a3)
 Push a lazily-created cleanup on the stack.
template<class T , class A0 , class A1 , class A2 , class A3 , class A4 >
void pushCleanup (CleanupKind Kind, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
 Push a lazily-created cleanup on the stack.
template<class T , class A0 , class A1 , class A2 >
T * pushCleanupWithExtra (CleanupKind Kind, size_t N, A0 a0, A1 a1, A2 a2)
void pushCopyOfCleanup (CleanupKind Kind, const void *Cleanup, size_t Size)
void popCleanup ()
 Pops a cleanup scope off the stack. This is private to CGCleanup.cpp.
class EHCatchScopepushCatch (unsigned NumHandlers)
void popCatch ()
 Pops a catch scope off the stack. This is private to CGException.cpp.
class EHFilterScopepushFilter (unsigned NumFilters)
 Push an exceptions filter on the stack.
void popFilter ()
 Pops an exceptions filter off the stack.
void pushTerminate ()
 Push a terminate handler on the stack.
void popTerminate ()
 Pops a terminate handler off the stack.
bool empty () const
 Determines whether the exception-scopes stack is empty.
bool requiresLandingPad () const
bool hasNormalCleanups () const
 Determines whether there are any normal cleanups on the stack.
stable_iterator getInnermostNormalCleanup () const
stable_iterator getInnermostActiveNormalCleanup () const
stable_iterator getInnermostEHScope () const
stable_iterator getInnermostActiveEHScope () const
iterator begin () const
 Returns an iterator pointing to the innermost EH scope.
iterator end () const
 Returns an iterator pointing to the outermost EH scope.
stable_iterator stable_begin () const
stable_iterator stabilize (iterator it) const
 Translates an iterator into a stable_iterator.
iterator find (stable_iterator save) const
void removeCleanup (stable_iterator save)
 Removes the cleanup pointed to by the given stable_iterator.
BranchFixupaddBranchFixup ()
 Add a branch fixup to the current cleanup scope.
unsigned getNumBranchFixups () const
BranchFixupgetBranchFixup (unsigned I)
void popNullFixups ()
void clearFixups ()

Static Public Member Functions

static stable_iterator stable_end ()
 Create a stable reference to the bottom of the EH stack.

Detailed Description

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

Definition at line 90 of file EHScopeStack.h.


Constructor & Destructor Documentation

Definition at line 304 of file EHScopeStack.h.

Definition at line 307 of file EHScopeStack.h.


Member Function Documentation

Add a branch fixup to the current cleanup scope.

Definition at line 464 of file EHScopeStack.h.

References hasNormalCleanups().

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

Definition at line 483 of file EHScopeStack.h.

Referenced by ResolveAllBranchFixups().

Returns an iterator pointing to the outermost EH scope.

Definition at line 517 of file CGCleanup.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitLandingPad().

Definition at line 471 of file EHScopeStack.h.

References getNumBranchFixups().

Referenced by ResolveAllBranchFixups().

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

Definition at line 420 of file EHScopeStack.h.

Referenced by getInnermostActiveNormalCleanup(), clang::CodeGen::CodeGenFunction::getJumpDestInCurrentScope(), IsUsedAsNormalCleanup(), and clang::CodeGen::CodeGenFunction::LexicalScope::rescopeLabels().

Definition at line 470 of file EHScopeStack.h.

Referenced by getBranchFixup(), and ResolveAllBranchFixups().

Determines whether there are any normal cleanups on the stack.

Definition at line 414 of file EHScopeStack.h.

References stable_end().

Referenced by addBranchFixup(), clang::CodeGen::CodeGenFunction::EmitLabel(), popCleanup(), and popNullFixups().

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.

Remove any 'null' fixups on the stack. However, we can't pop more fixups than the fixup depth on the innermost normal cleanup, or else fixups that we try to add to that cleanup will end up in the wrong place. We *could* try to shrink fixup depths, but that's actually a lot of work for little benefit.

Definition at line 238 of file CGCleanup.cpp.

References find(), and hasNormalCleanups().

Referenced by popCleanup().

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.

Definition at line 219 of file CGCleanup.cpp.

References clang::CodeGen::EHCatchScope::getSizeForNumHandlers(), and stable_begin().

Referenced by clang::CodeGen::CGObjCRuntime::EmitTryCatchStmt(), clang::CodeGen::CodeGenFunction::FinallyInfo::enter(), and clang::CodeGen::CodeGenFunction::EnterCXXTryStmt().

template<class T >
void clang::CodeGen::EHScopeStack::pushCleanup ( CleanupKind  Kind) [inline]

Push a lazily-created cleanup on the stack.

Definition at line 313 of file EHScopeStack.h.

template<class T , class A0 >
void clang::CodeGen::EHScopeStack::pushCleanup ( CleanupKind  Kind,
A0  a0 
) [inline]

Push a lazily-created cleanup on the stack.

Definition at line 321 of file EHScopeStack.h.

template<class T , class A0 , class A1 >
void clang::CodeGen::EHScopeStack::pushCleanup ( CleanupKind  Kind,
A0  a0,
A1  a1 
) [inline]

Push a lazily-created cleanup on the stack.

Definition at line 329 of file EHScopeStack.h.

template<class T , class A0 , class A1 , class A2 >
void clang::CodeGen::EHScopeStack::pushCleanup ( CleanupKind  Kind,
A0  a0,
A1  a1,
A2  a2 
) [inline]

Push a lazily-created cleanup on the stack.

Definition at line 337 of file EHScopeStack.h.

template<class T , class A0 , class A1 , class A2 , class A3 >
void clang::CodeGen::EHScopeStack::pushCleanup ( CleanupKind  Kind,
A0  a0,
A1  a1,
A2  a2,
A3  a3 
) [inline]

Push a lazily-created cleanup on the stack.

Definition at line 345 of file EHScopeStack.h.

template<class T , class A0 , class A1 , class A2 , class A3 , class A4 >
void clang::CodeGen::EHScopeStack::pushCleanup ( CleanupKind  Kind,
A0  a0,
A1  a1,
A2  a2,
A3  a3,
A4  a4 
) [inline]

Push a lazily-created cleanup on the stack.

Definition at line 353 of file EHScopeStack.h.

template<class T , class A0 , class A1 , class A2 >
T* clang::CodeGen::EHScopeStack::pushCleanupWithExtra ( CleanupKind  Kind,
size_t  N,
A0  a0,
A1  a1,
A2  a2 
) [inline]

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.

Definition at line 373 of file EHScopeStack.h.

Referenced by EnterNewDeleteCleanup().

void clang::CodeGen::EHScopeStack::pushCopyOfCleanup ( CleanupKind  Kind,
const void *  Cleanup,
size_t  Size 
) [inline]

Definition at line 378 of file EHScopeStack.h.

Push a terminate handler on the stack.

Definition at line 227 of file CGCleanup.cpp.

References clang::CodeGen::EHTerminateScope::getSize(), and stable_begin().

Referenced by EmitCleanup(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), and InitCatchParam().

Removes the cleanup pointed to by the given stable_iterator.

Translates an iterator into a stable_iterator.

Definition at line 544 of file CGCleanup.h.


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