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
This commit is contained in:
Andreas Rumpf 2020-03-18 16:57:34 +01:00 • committed by GitHub
commit fb641483f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 312 additions and 95 deletions

View file

@ -451,6 +451,7 @@ for expressions of type ``lent T`` or of type ``var T``.
result = Tree(kids: kids)
# converted into:
`=sink`(result.kids, kids); wasMoved(kids)
`=destroy`(kids)
proc `[]`*(x: Tree; i: int): lent Tree =
result = x.kids[i]