mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 00:55:49 +03:00
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:
parent
9f728a4b4c
commit
126184a8b6
7 changed files with 107 additions and 109 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue