clang API Documentation
#include <CodeGenFunction.h>
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 | popCleanup () |
| Pops a cleanup scope off the stack. This is private to CGCleanup.cpp. | |
| class EHCatchScope * | pushCatch (unsigned NumHandlers) |
| void | popCatch () |
| Pops a catch scope off the stack. This is private to CGException.cpp. | |
| class EHFilterScope * | pushFilter (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. | |
| BranchFixup & | addBranchFixup () |
| Add a branch fixup to the current cleanup scope. | |
| unsigned | getNumBranchFixups () const |
| BranchFixup & | getBranchFixup (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. | |
A stack of scopes which respond to exceptions, including cleanups and catch blocks.
Definition at line 141 of file CodeGenFunction.h.
| clang::CodeGen::EHScopeStack::EHScopeStack | ( | ) | [inline] |
Definition at line 356 of file CodeGenFunction.h.
| clang::CodeGen::EHScopeStack::~EHScopeStack | ( | ) | [inline] |
Definition at line 359 of file CodeGenFunction.h.
| BranchFixup& clang::CodeGen::EHScopeStack::addBranchFixup | ( | ) | [inline] |
Add a branch fixup to the current cleanup scope.
Definition at line 511 of file CodeGenFunction.h.
References hasNormalCleanups().
| EHScopeStack::iterator clang::CodeGen::EHScopeStack::begin | ( | ) | const [inline] |
Returns an iterator pointing to the innermost EH scope.
Definition at line 500 of file CGCleanup.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitEndEHSpec(), clang::CodeGen::CodeGenFunction::EmitLandingPad(), clang::CodeGen::CodeGenFunction::FinallyInfo::exit(), clang::CodeGen::CodeGenFunction::ExitCXXTryStmt(), clang::CodeGen::CodeGenFunction::getInvokeDestImpl(), clang::CodeGen::CodeGenFunction::initFullExprCleanup(), popCatch(), clang::CodeGen::CodeGenFunction::popCatchScope(), popCleanup(), popFilter(), and popTerminate().
| void clang::CodeGen::EHScopeStack::clearFixups | ( | ) | [inline] |
Clears the branch-fixups list. This should only be called by ResolveAllBranchFixups.
Definition at line 530 of file CodeGenFunction.h.
Referenced by ResolveAllBranchFixups().
| bool clang::CodeGen::EHScopeStack::empty | ( | ) | const [inline] |
Determines whether the exception-scopes stack is empty.
Definition at line 454 of file CodeGenFunction.h.
Referenced by clang::CodeGen::CodeGenFunction::FinishFunction(), clang::CodeGen::CodeGenFunction::getInvokeDestImpl(), popCatch(), popCleanup(), popFilter(), popTerminate(), and clang::CodeGen::CodeGenFunction::SimplifyForwardingBlocks().
| EHScopeStack::iterator clang::CodeGen::EHScopeStack::end | ( | ) | const [inline] |
Returns an iterator pointing to the outermost EH scope.
Definition at line 504 of file CGCleanup.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitLandingPad().
| EHScopeStack::iterator clang::CodeGen::EHScopeStack::find | ( | stable_iterator | save | ) | const [inline] |
Turn a stable reference to a scope depth into a unstable pointer to the EH stack.
Definition at line 524 of file CGCleanup.h.
References clang::CodeGen::EHScopeStack::stable_iterator::isValid(), and stable_begin().
Referenced by clang::CodeGen::CodeGenFunction::EmitLandingPad(), clang::CodeGen::CodeGenFunction::getEHDispatchBlock(), getInnermostActiveEHScope(), getInnermostActiveNormalCleanup(), IsUsedAsEHCleanup(), IsUsedAsNormalCleanup(), popNullFixups(), and SetupCleanupBlockActivation().
| BranchFixup& clang::CodeGen::EHScopeStack::getBranchFixup | ( | unsigned | I | ) | [inline] |
Definition at line 518 of file CodeGenFunction.h.
References getNumBranchFixups().
Referenced by ResolveAllBranchFixups().
| EHScopeStack::stable_iterator EHScopeStack::getInnermostActiveEHScope | ( | ) | const |
Definition at line 131 of file CGCleanup.cpp.
References find(), clang::CodeGen::EHScope::getEnclosingEHScope(), getInnermostEHScope(), clang::CodeGen::EHCleanupScope::isActive(), and stable_end().
| EHScopeStack::stable_iterator EHScopeStack::getInnermostActiveNormalCleanup | ( | ) | const |
Definition at line 121 of file CGCleanup.cpp.
References find(), clang::CodeGen::EHCleanupScope::getEnclosingNormalCleanup(), getInnermostNormalCleanup(), clang::CodeGen::EHCleanupScope::isActive(), and stable_end().
| stable_iterator clang::CodeGen::EHScopeStack::getInnermostEHScope | ( | ) | const [inline] |
Definition at line 472 of file CodeGenFunction.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitLandingPad(), getInnermostActiveEHScope(), IsUsedAsEHCleanup(), and pushFilter().
| stable_iterator clang::CodeGen::EHScopeStack::getInnermostNormalCleanup | ( | ) | const [inline] |
Returns the innermost normal cleanup on the stack, or stable_end() if there are no normal cleanups.
Definition at line 467 of file CodeGenFunction.h.
Referenced by getInnermostActiveNormalCleanup(), clang::CodeGen::CodeGenFunction::getJumpDestInCurrentScope(), and IsUsedAsNormalCleanup().
| unsigned clang::CodeGen::EHScopeStack::getNumBranchFixups | ( | ) | const [inline] |
Definition at line 517 of file CodeGenFunction.h.
Referenced by getBranchFixup(), and ResolveAllBranchFixups().
| bool clang::CodeGen::EHScopeStack::hasNormalCleanups | ( | ) | const [inline] |
Determines whether there are any normal cleanups on the stack.
Definition at line 461 of file CodeGenFunction.h.
References stable_end().
Referenced by addBranchFixup(), popCleanup(), and popNullFixups().
| void clang::CodeGen::EHScopeStack::popCatch | ( | ) | [inline] |
Pops a catch scope off the stack. This is private to CGException.cpp.
Definition at line 508 of file CGCleanup.h.
References begin(), empty(), clang::CodeGen::EHScope::getEnclosingEHScope(), clang::CodeGen::EHCatchScope::getNumHandlers(), and clang::CodeGen::EHCatchScope::getSizeForNumHandlers().
Referenced by clang::CodeGen::CodeGenFunction::ExitCXXTryStmt(), and clang::CodeGen::CodeGenFunction::popCatchScope().
| void EHScopeStack::popCleanup | ( | ) |
Pops a cleanup scope off the stack. This is private to CGCleanup.cpp.
Definition at line 171 of file CGCleanup.cpp.
References begin(), empty(), clang::CodeGen::EHCleanupScope::getAllocatedSize(), clang::CodeGen::EHScope::getEnclosingEHScope(), clang::CodeGen::EHCleanupScope::getEnclosingNormalCleanup(), hasNormalCleanups(), popNullFixups(), and clang::CodeGen::EHCleanupScope::~EHCleanupScope().
| void EHScopeStack::popFilter | ( | ) |
Pops an exceptions filter off the stack.
Definition at line 204 of file CGCleanup.cpp.
References begin(), empty(), clang::CodeGen::EHScope::getEnclosingEHScope(), clang::CodeGen::EHFilterScope::getNumFilters(), and clang::CodeGen::EHFilterScope::getSizeForNumFilters().
Referenced by clang::CodeGen::CodeGenFunction::EmitEndEHSpec().
| void EHScopeStack::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 232 of file CGCleanup.cpp.
References find(), and hasNormalCleanups().
Referenced by popCleanup().
| void clang::CodeGen::EHScopeStack::popTerminate | ( | ) | [inline] |
Pops a terminate handler off the stack.
Definition at line 516 of file CGCleanup.h.
References begin(), empty(), clang::CodeGen::EHScope::getEnclosingEHScope(), and clang::CodeGen::EHTerminateScope::getSize().
Referenced by EmitCleanup(), clang::CodeGen::CodeGenFunction::EmitEndEHSpec(), and InitCatchParam().
| 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 213 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().
| void clang::CodeGen::EHScopeStack::pushCleanup | ( | CleanupKind | Kind | ) | [inline] |
Push a lazily-created cleanup on the stack.
Definition at line 365 of file CodeGenFunction.h.
| void clang::CodeGen::EHScopeStack::pushCleanup | ( | CleanupKind | Kind, |
| A0 | a0 | ||
| ) | [inline] |
Push a lazily-created cleanup on the stack.
Definition at line 373 of file CodeGenFunction.h.
| void clang::CodeGen::EHScopeStack::pushCleanup | ( | CleanupKind | Kind, |
| A0 | a0, | ||
| A1 | a1 | ||
| ) | [inline] |
Push a lazily-created cleanup on the stack.
Definition at line 381 of file CodeGenFunction.h.
| 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 389 of file CodeGenFunction.h.
| 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 397 of file CodeGenFunction.h.
| 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 405 of file CodeGenFunction.h.
| 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 425 of file CodeGenFunction.h.
Referenced by EnterNewDeleteCleanup().
| EHFilterScope * EHScopeStack::pushFilter | ( | unsigned | NumFilters | ) |
Push an exceptions filter on the stack.
Definition at line 196 of file CGCleanup.cpp.
References getInnermostEHScope(), clang::CodeGen::EHFilterScope::getSizeForNumFilters(), stable_begin(), and stable_end().
Referenced by clang::CodeGen::CodeGenFunction::EmitStartEHSpec().
| void EHScopeStack::pushTerminate | ( | ) |
Push a terminate handler on the stack.
Definition at line 221 of file CGCleanup.cpp.
References clang::CodeGen::EHTerminateScope::getSize(), and stable_begin().
Referenced by EmitCleanup(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), and InitCatchParam().
| void clang::CodeGen::EHScopeStack::removeCleanup | ( | stable_iterator | save | ) |
Removes the cleanup pointed to by the given stable_iterator.
| bool clang::CodeGen::EHScopeStack::requiresLandingPad | ( | ) | const [inline] |
Definition at line 456 of file CodeGenFunction.h.
References stable_end().
Referenced by clang::CodeGen::CodeGenFunction::EmitLandingPad(), clang::CodeGen::CodeGenFunction::getInvokeDest(), and clang::CodeGen::CodeGenFunction::getInvokeDestImpl().
| EHScopeStack::stable_iterator clang::CodeGen::EHScopeStack::stabilize | ( | iterator | it | ) | const [inline] |
Translates an iterator into a stable_iterator.
Definition at line 531 of file CGCleanup.h.
| stable_iterator clang::CodeGen::EHScopeStack::stable_begin | ( | ) | const [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 491 of file CodeGenFunction.h.
Referenced by EmitAnyExprToExn(), clang::CodeGen::CodeGenFunction::EmitConstructorBody(), clang::CodeGen::CodeGenFunction::EmitLabel(), clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), enterBlockScope(), find(), clang::CodeGen::CodeGenFunction::FinishFunction(), pushCatch(), pushFilter(), pushTerminate(), clang::CodeGen::CodeGenFunction::RunCleanupsScope::requiresCleanups(), clang::CodeGen::CodeGenFunction::RunCleanupsScope::RunCleanupsScope(), and clang::CodeGen::CodeGenFunction::StartFunction().
| static stable_iterator clang::CodeGen::EHScopeStack::stable_end | ( | ) | [inline, static] |
Create a stable reference to the bottom of the EH stack.
Definition at line 496 of file CodeGenFunction.h.
Referenced by clang::CodeGen::CodeGenFunction::getEHDispatchBlock(), getInnermostActiveEHScope(), getInnermostActiveNormalCleanup(), hasNormalCleanups(), pushFilter(), and requiresLandingPad().