[clang] [CIR] Implement EH handling for field initializers (PR #192360)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 16 06:14:25 PDT 2026


================
@@ -1071,6 +1071,17 @@ void CIRGenFunction::pushIrregularPartialArrayCleanup(mlir::Value arrayBegin,
       destroyer);
 }
 
+/// pushEHDestroy - Push the standard destructor for the given type as
+/// an EH-only cleanup.
+void CIRGenFunction::pushEHDestroy(QualType::DestructionKind dtorKind,
----------------
erichkeane wrote:

I wonder if this function should be doing the `if(needsEHCleanup)` instead?  so more of a `push-eh-destroy-if-necessary?  

I see we have `pushDestroy` which has a similar assertion (though asserts a little differently?), but I wonder if it would be less error-prone if we moved the determination as to whether to emit these ore not into this function.

WDYT? 

https://github.com/llvm/llvm-project/pull/192360


More information about the cfe-commits mailing list