Skip to content

Commit

Permalink
Merge branch 'stmt-expr-coro-cleanups' of https://github.com/usx95/ll…
Browse files Browse the repository at this point in the history
…vm-project into stmt-expr-coro-cleanups
  • Loading branch information
usx95 committed Mar 31, 2024
2 parents 4833db8 + fb30378 commit a7c9327
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions clang/lib/CodeGen/CodeGenFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,19 @@ class CodeGenFunction : public CodeGenTypeCache {
{EHStack.stable_begin(), DominatingIP});
}

// Push a cleanup onto EHStack and deactivate it later. It is usually
// deactivated when exiting a `CleanupDeactivationScope` (for example: after a
// full expression).
template <class T, class... As>
void pushCleanupAndDeferDeactivation(CleanupKind Kind, As... A) {
// Placeholder dominating IP for this cleanup.
llvm::Instruction *DominatingIP =
Builder.CreateFlagLoad(llvm::Constant::getNullValue(Int8PtrTy));
EHStack.pushCleanup<T>(Kind, A...);
DeferredDeactivationCleanupStack.push_back(
{EHStack.stable_begin(), DominatingIP});
}

/// Set up the last cleanup that was pushed as a conditional
/// full-expression cleanup.
void initFullExprCleanup() {
Expand Down

0 comments on commit a7c9327

Please sign in to comment.