mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-06 20:09:03 +02:00
Refactor struct initializers codegen.
This not only reduces code duplication, but the unification also enables code a la StructLiteralExp to handle classes (for CTFE class constant support in 2.063).
This commit is contained in:
@@ -91,6 +91,9 @@ IrTypeStruct* IrTypeStruct::get(StructDeclaration* sd)
|
||||
if (sd->sizeok != 1)
|
||||
return t;
|
||||
|
||||
// TODO:: Somehow merge this with IrAggr::createInitializerConstant, or
|
||||
// replace it by just taking the type of the default initializer.
|
||||
|
||||
// mirror the sd->fields array but only fill in contributors
|
||||
size_t n = sd->fields.dim;
|
||||
LLSmallVector<VarDeclaration*, 16> data(n, NULL);
|
||||
|
||||
Reference in New Issue
Block a user