[clang] [CIR] Fix structors for multidimensional arrrays (PR #159820)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 19 11:56:58 PDT 2025


xlauko wrote:

> I wonder whether we should immediately flatten multidimensional arrays in CIR instead of casting pointers. Do we need this information for something?
> 
> Maybe it's also better for `ArrayCtor`/`ArrayDtor` to use a pair of pointers instead of relying on the `ArrayType` size in `LoweringPrepare`. That makes easier to implement VLAs later on and it's possible that it could improve code size when generating cleanups in the case of destructors because we don't have to generate a new loop for each element in the array.

Not sure about specific usecase, but in general I would be for keeping as much info as we can if does not cost us much.

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


More information about the cfe-commits mailing list