From ca6b37cd3872db624d3b328ee0efcda5cdfc1d43 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Mon, 3 Nov 2008 15:23:22 +0100 Subject: [PATCH] Enable function parameter debug info for a wider range of args. --- gen/functions.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/gen/functions.cpp b/gen/functions.cpp index 8a14378f..825fe434 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -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); } }