mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-06 10:57:35 +03:00
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:
parent
71023952d4
commit
1999749415
3 changed files with 57 additions and 43 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue