clang
8.0.0
|
A stack of scopes which respond to exceptions, including cleanups and catch blocks. More...
#include "/work/llvm-www-releases/8.0.0/docsbuild/llvm.src/tools/clang/lib/CodeGen/EHScopeStack.h"
Classes | |
class | Cleanup |
Information for lazily generating a cleanup. More... | |
class | ConditionalCleanup |
ConditionalCleanup stores the saved form of its parameters, then restores them and performs the cleanup. More... | |
class | iterator |
A non-stable pointer into the scope stack. More... | |
class | stable_iterator |
A saved depth on the scope stack. More... | |
Public Types | |
enum | { ScopeStackAlignment = 8 } |
Public Member Functions | |
EHScopeStack () | |
~EHScopeStack () | |
template<class T , class... As> | |
void | pushCleanup (CleanupKind Kind, As... A) |
Push a lazily-created cleanup on the stack. More... | |
template<class T , class... As> | |
void | pushCleanupTuple (CleanupKind Kind, std::tuple< As... > A) |
Push a lazily-created cleanup on the stack. Tuple version. More... | |
template<class T , class... As> | |
T * | pushCleanupWithExtra (CleanupKind Kind, size_t N, As... A) |
Push a cleanup with non-constant storage requirements on the stack. More... | |
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. More... | |
class EHCatchScope * | pushCatch (unsigned NumHandlers) |
Push a set of catch handlers on the stack. More... | |
void | popCatch () |
Pops a catch scope off the stack. This is private to CGException.cpp. More... | |
class EHFilterScope * | pushFilter (unsigned NumFilters) |
Push an exceptions filter on the stack. More... | |
void | popFilter () |
Pops an exceptions filter off the stack. More... | |
void | pushTerminate () |
Push a terminate handler on the stack. More... | |
void | popTerminate () |
Pops a terminate handler off the stack. More... | |
bool | containsOnlyLifetimeMarkers (stable_iterator Old) const |
bool | empty () const |
Determines whether the exception-scopes stack is empty. More... | |
bool | requiresLandingPad () const |
bool | hasNormalCleanups () const |
Determines whether there are any normal cleanups on the stack. More... | |
stable_iterator | getInnermostNormalCleanup () const |
Returns the innermost normal cleanup on the stack, or stable_end() if there are no normal cleanups. More... | |
stable_iterator | getInnermostActiveNormalCleanup () const |
stable_iterator | getInnermostEHScope () const |
iterator | begin () const |
Returns an iterator pointing to the innermost EH scope. More... | |
iterator | end () const |
Returns an iterator pointing to the outermost EH scope. More... | |
stable_iterator | stable_begin () const |
Create a stable reference to the top of the EH stack. More... | |
stable_iterator | stabilize (iterator it) const |
Translates an iterator into a stable_iterator. More... | |
iterator | find (stable_iterator save) const |
Turn a stable reference to a scope depth into a unstable pointer to the EH stack. More... | |
BranchFixup & | addBranchFixup () |
Add a branch fixup to the current cleanup scope. More... | |
unsigned | getNumBranchFixups () const |
BranchFixup & | getBranchFixup (unsigned I) |
void | popNullFixups () |
Pops lazily-removed fixups from the end of the list. More... | |
void | clearFixups () |
Clears the branch-fixups list. More... | |
Static Public Member Functions | |
static stable_iterator | stable_end () |
Create a stable reference to the bottom of the EH stack. More... | |
A stack of scopes which respond to exceptions, including cleanups and catch blocks.
Definition at line 100 of file EHScopeStack.h.
anonymous enum |
Enumerator | |
---|---|
ScopeStackAlignment |
Definition at line 103 of file EHScopeStack.h.
|
inline |
Definition at line 267 of file EHScopeStack.h.
|
inline |
Definition at line 270 of file EHScopeStack.h.
|
inline |
Add a branch fixup to the current cleanup scope.
Definition at line 396 of file EHScopeStack.h.
|
inline |
Returns an iterator pointing to the innermost EH scope.
Definition at line 567 of file CGCleanup.h.
Referenced by containsOnlyLifetimeMarkers(), clang::CodeGen::CodeGenFunction::FinallyInfo::exit(), popCleanup(), and popFilter().
|
inline |
Clears the branch-fixups list.
This should only be called by ResolveAllBranchFixups.
Definition at line 415 of file EHScopeStack.h.
Referenced by ResolveAllBranchFixups().
bool EHScopeStack::containsOnlyLifetimeMarkers | ( | EHScopeStack::stable_iterator | Old | ) | const |
Definition at line 148 of file CGCleanup.cpp.
References begin(), clang::format::cleanup(), clang::CodeGen::EHCleanupScope::isLifetimeMarker(), and stabilize().
Referenced by clang::CodeGen::CodeGenFunction::FinishFunction().
|
inline |
Determines whether the exception-scopes stack is empty.
Definition at line 345 of file EHScopeStack.h.
Referenced by clang::CodeGen::CodeGenFunction::FinishFunction(), popCleanup(), popFilter(), and clang::CodeGen::CodeGenFunction::SimplifyForwardingBlocks().
|
inline |
Returns an iterator pointing to the outermost EH scope.
Definition at line 571 of file CGCleanup.h.
|
inline |
Turn a stable reference to a scope depth into a unstable pointer to the EH stack.
Definition at line 591 of file CGCleanup.h.
References clang::CodeGen::EHScopeStack::stable_iterator::isValid().
Referenced by getInnermostActiveNormalCleanup(), IsUsedAsEHCleanup(), IsUsedAsNormalCleanup(), popNullFixups(), requiresLandingPad(), and SetupCleanupBlockActivation().
|
inline |
Definition at line 403 of file EHScopeStack.h.
Referenced by ResolveAllBranchFixups().
EHScopeStack::stable_iterator EHScopeStack::getInnermostActiveNormalCleanup | ( | ) | const |
Definition at line 174 of file CGCleanup.cpp.
References clang::format::cleanup(), clang::CodeGen::EHCleanup, find(), clang::CodeGen::EHCleanupScope::getCleanupBuffer(), clang::CodeGen::EHCleanupScope::getEnclosingNormalCleanup(), getInnermostNormalCleanup(), clang::CodeGen::EHCleanupScope::getSizeForCleanupSize(), clang::CodeGen::InactiveCleanup, clang::CodeGen::EHCleanupScope::isActive(), clang::CodeGen::LifetimeMarker, clang::CodeGen::NormalCleanup, clang::CodeGen::EHCleanupScope::setLifetimeMarker(), stable_begin(), and stable_end().
|
inline |
Definition at line 361 of file EHScopeStack.h.
Referenced by IsUsedAsEHCleanup(), pushFilter(), and requiresLandingPad().
|
inline |
Returns the innermost normal cleanup on the stack, or stable_end() if there are no normal cleanups.
Definition at line 356 of file EHScopeStack.h.
Referenced by getInnermostActiveNormalCleanup(), clang::CodeGen::CodeGenFunction::getJumpDestInCurrentScope(), and IsUsedAsNormalCleanup().
|
inline |
Definition at line 402 of file EHScopeStack.h.
Referenced by ResolveAllBranchFixups().
|
inline |
Determines whether there are any normal cleanups on the stack.
Definition at line 350 of file EHScopeStack.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitLabel(), popCleanup(), and popNullFixups().
|
inline |
Pops a catch scope off the stack. This is private to CGException.cpp.
Definition at line 575 of file CGCleanup.h.
References clang::CodeGen::EHScope::getEnclosingEHScope(), and clang::CodeGen::EHCatchScope::getNumHandlers().
void EHScopeStack::popCleanup | ( | ) |
Pops a cleanup scope off the stack. This is private to CGCleanup.cpp.
Definition at line 209 of file CGCleanup.cpp.
References begin(), clang::CodeGen::EHCleanupScope::Destroy(), empty(), clang::CodeGen::EHCleanupScope::getAllocatedSize(), clang::CodeGen::EHScope::getEnclosingEHScope(), clang::CodeGen::EHCleanupScope::getEnclosingNormalCleanup(), hasNormalCleanups(), and popNullFixups().
void EHScopeStack::popFilter | ( | ) |
Pops an exceptions filter off the stack.
Definition at line 242 of file CGCleanup.cpp.
References begin(), empty(), clang::CodeGen::EHScope::getEnclosingEHScope(), clang::CodeGen::EHFilterScope::getNumFilters(), and clang::CodeGen::EHFilterScope::getSizeForNumFilters().
void EHScopeStack::popNullFixups | ( | ) |
Pops lazily-removed fixups from the end of the list.
Remove any 'null' fixups on the stack.
This should only be called by procedures which have just popped a cleanup or resolved one or more fixups.
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 270 of file CGCleanup.cpp.
References find(), and hasNormalCleanups().
Referenced by popCleanup().
|
inline |
Pops a terminate handler off the stack.
Definition at line 583 of file CGCleanup.h.
References clang::CodeGen::EHScope::getEnclosingEHScope().
Referenced by InitCatchParam(), and clang::CodeGen::ReductionCodeGen::usesReductionInitializer().
EHCatchScope * EHScopeStack::pushCatch | ( | unsigned | NumHandlers | ) |
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 251 of file CGCleanup.cpp.
References clang::CodeGen::EHCatchScope::getSizeForNumHandlers(), and stable_begin().
Referenced by clang::CodeGen::CodeGenFunction::FinallyInfo::enter().
|
inline |
Push a lazily-created cleanup on the stack.
Definition at line 273 of file EHScopeStack.h.
|
inline |
Push a lazily-created cleanup on the stack. Tuple version.
Definition at line 283 of file EHScopeStack.h.
Referenced by clang::CodeGen::CodeGenFunction::pushFullExprCleanup().
|
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 305 of file EHScopeStack.h.
Referenced by EnterNewDeleteCleanup().
|
inline |
Definition at line 312 of file EHScopeStack.h.
References memcpy().
EHFilterScope * EHScopeStack::pushFilter | ( | unsigned | NumFilters | ) |
Push an exceptions filter on the stack.
Definition at line 234 of file CGCleanup.cpp.
References getInnermostEHScope(), clang::CodeGen::EHFilterScope::getSizeForNumFilters(), stable_begin(), and stable_end().
void EHScopeStack::pushTerminate | ( | ) |
Push a terminate handler on the stack.
Definition at line 259 of file CGCleanup.cpp.
References clang::CodeGen::EHTerminateScope::getSize(), and stable_begin().
Referenced by InitCatchParam(), and clang::CodeGen::ReductionCodeGen::usesReductionInitializer().
bool EHScopeStack::requiresLandingPad | ( | ) | const |
Definition at line 159 of file CGCleanup.cpp.
References clang::format::cleanup(), find(), getInnermostEHScope(), and stable_end().
Referenced by clang::CodeGen::CodeGenFunction::getInvokeDest(), and clang::CodeGen::CGOpenMPRuntime::getThreadID().
|
inline |
Translates an iterator into a stable_iterator.
Definition at line 598 of file CGCleanup.h.
Referenced by containsOnlyLifetimeMarkers().
|
inline |
Create a stable reference to the top of the EH stack.
The returned reference is valid until that scope is popped off the stack.
Definition at line 379 of file EHScopeStack.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitLabel(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), enterBlockScope(), clang::CodeGen::CodeGenFunction::FinishFunction(), getInnermostActiveNormalCleanup(), isSimpleZero(), isTrivialFiller(), pushCatch(), pushFilter(), pushTerminate(), clang::CodeGen::CodeGenFunction::RunCleanupsScope::requiresCleanups(), clang::CodeGen::CodeGenFunction::RunCleanupsScope::RunCleanupsScope(), and clang::CodeGen::CodeGenFunction::StartFunction().
|
inlinestatic |
Create a stable reference to the bottom of the EH stack.
Definition at line 384 of file EHScopeStack.h.
Referenced by getInnermostActiveNormalCleanup(), pushFilter(), requiresLandingPad(), and clang::CodeGen::CodeGenFunction::LexicalScope::rescopeLabels().