mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 15:40:55 +03:00
Enforce type consistency for most DValues
At the cost of some more bitcasts.
This commit is contained in:
parent
88b19d3d51
commit
d6dcc7a4db
7 changed files with 78 additions and 99 deletions
|
@ -590,11 +590,11 @@ void initializeArrayLiteral(IRState *p, ArrayLiteralExp *ale, LLValue *dstMem) {
|
|||
} else {
|
||||
// Store the elements one by one.
|
||||
for (size_t i = 0; i < elemCount; ++i) {
|
||||
DValue *e = toElem(indexArrayLiteral(ale, i));
|
||||
DValue *rhs = toElem(indexArrayLiteral(ale, i));
|
||||
|
||||
LLValue *elemAddr = DtoGEPi(dstMem, 0, i, "", p->scopebb());
|
||||
auto vv = new DLValue(e->type, elemAddr);
|
||||
DtoAssign(ale->loc, vv, e, TOKconstruct, true);
|
||||
LLValue *lhsPtr = DtoGEPi(dstMem, 0, i, "", p->scopebb());
|
||||
DLValue lhs(rhs->type, DtoBitCast(lhsPtr, DtoPtrToType(rhs->type)));
|
||||
DtoAssign(ale->loc, &lhs, rhs, TOKconstruct, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue