diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2020-03-18 16:57:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-18 16:57:34 +0100 |
commit | fb641483f0e2ed974b89d629ea5ec28e5e6145ce (patch) | |
tree | 8f74544adb04d46a7946554e2fd73e6bbc417ff3 /compiler/ccgexprs.nim | |
parent | a96842aaeb46ddf3990f9632259a26cb451c5b80 (diff) | |
download | Nim-fb641483f0e2ed974b89d629ea5ec28e5e6145ce.tar.gz |
arc optimizations (#13325)
* scope based destructors * handle 'or' and 'and' expressions properly, see the new test arc/tcontrolflow.nim * make this branch mergable, logic is disabled for now
Diffstat (limited to 'compiler/ccgexprs.nim')
-rw-r--r-- | compiler/ccgexprs.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 4aad1a4f8..4cf6f36db 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -2573,6 +2573,10 @@ proc expr(p: BProc, n: PNode, d: var TLoc) = else: putLocIntoDest(p, d, sym.loc) of skTemp: + if sym.loc.r == nil: + # we now support undeclared 'skTemp' variables for easier + # transformations in other parts of the compiler: + assignLocalVar(p, n) if sym.loc.r == nil or sym.loc.t == nil: #echo "FAILED FOR PRCO ", p.prc.name.s #echo renderTree(p.prc.ast, {renderIds}) |