llvm-project
b7776cce - [CIR] Add support for array new with ctor init (#187418)

Commit
35 days ago
[CIR] Add support for array new with ctor init (#187418) This adds support for array new initialization that requires calling constructors. This diverges a bit from the classic codegen implementation in a couple of ways. First, we use the cir.array_ctor operation to represent all the constructor calls that weren't part of an explicit initializer list. This gets lowered to a loop during the LoweringPrepare pass. Second, because CIR uses more explicit types, we have to insert a bitcast of the array pointer to an explicit array type. Third, when an initializer list is provided and we are calling constructors for the "filler" portion of the list, we attempt to get the array size as a constant and create a "tail array" to initialize that is sized to the number of elements remaining.
Author
Parents
Loading