Files
llvm-project/clang/test/CIR/CodeGen/array-dtor.cpp
Andy Kaylor 9b64d05e59 [CIR] Implement partial array destroy handling (#190834)
This implements EH cleanup handling that performs regular partial array
destruction for array constructor loops with a destructed type. Because
CIR represents array construction using an abstract operation, we do not
go through the normal EH stack mechanism. Instead, we add a partial_dtor
region to the cir.array.ctor operation indicating how a single element
should be destructed. When the cir.array.ctor operation is expanded
during LoweringPrepare, we create a cleanup scope with a partial array
dtor loop in an EH cleanup region. This gets further expanded during CFG
flattening to produce a control flow equivalent to that generated by
classic codegen.

Assisted-by: Cursor / claude-4.6-opus-high
2026-04-08 12:22:15 -07:00

8.8 KiB