| Issue |
178551
|
| Summary |
[CIR] Implement handling for conditional lifetime cleanups
|
| Labels |
ClangIR
|
| Assignees |
|
| Reporter |
andykaylor
|
There are some situations where cleanups must be conditionally deactivated while they are still on the EHStack. See `ConditionalLifetimeExtended` with the `clang/test/CodeGenCXX/control-flow-in-stmt-expr.cpp` test for an example of code that triggers this condition.
This is handled in classic codegen by introducing a compiler-generated flag value which is set when the cleanup should be active and clear when the cleanup should not be active. This flag is then tested before the cleanup code is executed. We will likely want to use a similar solution in CIR, but we will need a way to represent this condition within the structured (`cir.cleanup.scope`) representation in CIR.
When this feature is implemented, the Clang IR EH design document (`clang/docs/ClangIRCleanupAndEHDesign.rst`) should be updated to describe the solution used.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs