code cleanup: remove newScopeForIf switch

This commit is contained in:
Andreas Rumpf 2018-07-04 20:04:08 +02:00
commit db35ac435b
5 changed files with 4 additions and 78 deletions

View file

@ -340,13 +340,12 @@ proc genIf(p: BProc, n: PNode, d: var TLoc) =
# bug #4230: avoid false sharing between branches:
if d.k == locTemp and isEmptyType(n.typ): d.k = locNone
if it.len == 2:
when newScopeForIf: startBlock(p)
startBlock(p)
initLocExprSingleUse(p, it.sons[0], a)
lelse = getLabel(p)
inc(p.labels)
lineF(p, cpsStmts, "if (!$1) goto $2;$n",
[rdLoc(a), lelse])
when not newScopeForIf: startBlock(p)
if p.module.compileToCpp:
# avoid "jump to label crosses initialization" error:
add(p.s(cpsStmts), "{")