[all-commits] [llvm/llvm-project] 70e5ec: [CIR] Handle full expression cleanups in condition...
Andy Kaylor via All-commits
all-commits at lists.llvm.org
Wed Apr 15 09:13:20 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 70e5ec47d2bdd8f54f5c2df3ec8b606d42f11804
https://github.com/llvm/llvm-project/commit/70e5ec47d2bdd8f54f5c2df3ec8b606d42f11804
Author: Andy Kaylor <akaylor at nvidia.com>
Date: 2026-04-15 (Wed, 15 Apr 2026)
Changed paths:
M clang/lib/CIR/CodeGen/CIRGenCleanup.cpp
M clang/lib/CIR/CodeGen/CIRGenDecl.cpp
M clang/lib/CIR/CodeGen/CIRGenExpr.cpp
M clang/lib/CIR/CodeGen/CIRGenExprAggregate.cpp
M clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
M clang/lib/CIR/CodeGen/CIRGenFunction.cpp
M clang/lib/CIR/CodeGen/CIRGenFunction.h
M clang/lib/CIR/CodeGen/CIRGenStmt.cpp
A clang/test/CIR/CodeGen/cleanup-conditional-eh.cpp
A clang/test/CIR/CodeGen/cleanup-conditional.cpp
Log Message:
-----------
[CIR] Handle full expression cleanups in conditional branches (#191479)
This adds CIR support for handling full expression cleanups in
conditional branches. Because CIR uses structured control flow, it was
necessary to handle these cleanups differently than is done in classic
codegen. CIR speculatively creates a cleanup scope when an
ExprWithCleanups contains a conditional operator and maintains a
dedicated stack of these deferred cleanups, which is added to the
cleanup scope at the end of the full expression with an active flag used
to control whether the cleanup should be executed based on any branches
that may have been taken during the conditional expression evaluation.
This is similar to the mechanism used for lifetime extended cleanups,
but the timing of when the cleanups are moved to the main EH stack is
different, so we need to maintain two different pending cleanup stacks.
We are able to use the same PendingCleanupEntry class for both.
Assisted-by: Cursor / claude-4.6-opus-high
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list