Enable function parameter debug info for a wider range of args.

This commit is contained in:
Christian Kamm
2008-11-03 15:23:22 +01:00
parent 16b38a7fef
commit ca6b37cd38

View File

@@ -745,22 +745,15 @@ void DtoDefineFunc(FuncDeclaration* fd)
bool refout = vd->storage_class & (STCref | STCout);
bool lazy = vd->storage_class & STClazy;
if (refout)
if (!refout && (!DtoIsPassedByRef(vd->type) || lazy))
{
continue;
LLValue* a = irloc->value;
LLValue* v = DtoAlloca(a->getType(), "."+a->getName());
DtoStore(a,v);
irloc->value = v;
}
else if (!lazy && DtoIsPassedByRef(vd->type))
{
LLValue* vdirval = irloc->value;
if (global.params.symdebug && !(isaArgument(vdirval) && !isaArgument(vdirval)->hasByValAttr()))
DtoDwarfLocalVariable(vdirval, vd);
continue;
}
LLValue* a = irloc->value;
LLValue* v = DtoAlloca(a->getType(), "."+a->getName());
DtoStore(a,v);
irloc->value = v;
if (global.params.symdebug && !(isaArgument(irloc->value) && !isaArgument(irloc->value)->hasByValAttr()) && !refout)
DtoDwarfLocalVariable(irloc->value, vd);
}
}