More in-place construction

Also for struct literal fields, array literal elements and associative array
literal elements as well as basic types allocated on the heap.
This commit is contained in:
Martin 2016-07-20 21:31:03 +02:00
parent 9f728a4b4c
commit 126184a8b6
7 changed files with 107 additions and 109 deletions

View file

@ -1090,14 +1090,6 @@ DValue *DtoArgument(Parameter *fnarg, Expression *argexp) {
return arg;
}
// byval arg, but expr has no storage yet
if (DtoIsInMemoryOnly(argexp->type) && (arg->isSlice() || arg->isNull())) {
LLValue *alloc = DtoAlloca(argexp->type, ".tmp_arg");
auto vv = new DLValue(argexp->type, alloc);
DtoAssign(argexp->loc, vv, arg);
arg = vv;
}
return arg;
}