Issue #426 part 2. Generate a try-finally block only if it is required

(i.e. there are actually some destructor calls that are needed to be put into finally)
This commit is contained in:
Alexey Prokhin 2013-07-10 12:45:41 +04:00
parent 71023952d4
commit 1999749415
3 changed files with 57 additions and 43 deletions

View file

@ -1055,7 +1055,7 @@ void DtoVarDeclaration(VarDeclaration* vd)
{
vd->ir.irLocal->value = val;
}
goto Lexit;
return;
}
}
}
@ -1087,15 +1087,6 @@ void DtoVarDeclaration(VarDeclaration* vd)
ex->exp->toElem(gIR);
}
}
Lexit:
/* Mark the point of construction of a variable that needs to be destructed.
*/
if (vd->edtor && !vd->noscope)
{
// Put vd on list of things needing destruction
gIR->varsInScope().push_back(vd);
}
}
DValue* DtoDeclarationExp(Dsymbol* declaration)