Only emit a single bitcast for struct literal padding.

Mostly a cosmetic change.
This commit is contained in:
David Nadlinger
2012-11-10 20:15:12 +01:00
parent 5944e9cc51
commit d14a869c19

View File

@@ -2935,6 +2935,7 @@ DValue* StructLiteralExp::toElem(IRState* p)
size_t nexprs = elements->dim;
Expression** exprs = (Expression**)elements->data;
// might be reset to an actual i8* value so only a single bitcast is emitted.
LLValue* voidptr = mem;
unsigned offset = 0;
@@ -3022,7 +3023,7 @@ DValue* StructLiteralExp::toElem(IRState* p)
}
// initialize trailing padding
if (sd->structsize != offset)
write_zeroes(voidptr, offset, sd->structsize);
voidptr = write_zeroes(voidptr, offset, sd->structsize);
// return as a var
return new DVarValue(type, mem);