[clang] [CIR] Add support for partial array cleanup with ILE (PR #198000)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Mon May 18 10:01:31 PDT 2026


================
@@ -1713,8 +1713,8 @@ class CIRGenFunction : public CIRGenTypeCache {
   void emitCXXAggrConstructorCall(const CXXConstructorDecl *ctor,
                                   mlir::Value numElements, Address arrayBase,
                                   const CXXConstructExpr *e,
-                                  bool newPointerIsChecked,
-                                  bool zeroInitialize);
+                                  bool newPointerIsChecked, bool zeroInitialize,
+                                  Address endOfInit = Address::invalid());
----------------
andykaylor wrote:

This is an overloaded function. There's one version that takes an `ArrayType` argument, uses that to get the number of elements, then calls this version to emit the constructor loop for the entire array. That version will never have pre-initialized any elements or pushed the partial array cleanup on the EH stack.

That's the only other caller of this form of the function besides the one modified in this PR. I can easily make it a required parameter and make it explicitly null in the wrapper function. Would that satisfy your concerns?

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


More information about the cfe-commits mailing list