Named Return Value Optimization

This commit is contained in:
Alexey Prokhin
2011-09-13 12:01:51 +04:00
parent 0e754b5acd
commit 9a9999854f
6 changed files with 55 additions and 23 deletions

View File

@@ -373,7 +373,7 @@ DValue* DtoCallFunction(Loc& loc, Type* resulttype, DValue* fnval, Expressions*
// return in hidden ptr is first
if (retinptr)
{
LLValue* retvar = DtoRawAlloca(argiter->get()->getContainedType(0), 0, ".rettmp");
LLValue* retvar = DtoRawAlloca(argiter->get()->getContainedType(0), resulttype->alignsize(), ".rettmp");
++argiter;
args.push_back(retvar);