diff options
Diffstat (limited to 'doc/destructors.md')
-rw-r--r-- | doc/destructors.md | 69 |
1 files changed, 34 insertions, 35 deletions
diff --git a/doc/destructors.md b/doc/destructors.md index b0dd42597..a96ac35ef 100644 --- a/doc/destructors.md +++ b/doc/destructors.md @@ -358,58 +358,57 @@ Rewrite rules The current implementation follows strategy (2). This means that resources are destroyed at the scope exit. -:: - var x: T; stmts - --------------- (destroy-var) - var x: T; try stmts - finally: `=destroy`(x) + var x: T; stmts + --------------- (destroy-var) + var x: T; try stmts + finally: `=destroy`(x) - g(f(...)) - ------------------------ (nested-function-call) - g(let tmp; - bitwiseCopy tmp, f(...); - tmp) - finally: `=destroy`(tmp) + g(f(...)) + ------------------------ (nested-function-call) + g(let tmp; + bitwiseCopy tmp, f(...); + tmp) + finally: `=destroy`(tmp) - x = f(...) - ------------------------ (function-sink) - `=sink`(x, f(...)) + x = f(...) + ------------------------ (function-sink) + `=sink`(x, f(...)) - x = lastReadOf z - ------------------ (move-optimization) - `=sink`(x, z) - wasMoved(z) + x = lastReadOf z + ------------------ (move-optimization) + `=sink`(x, z) + wasMoved(z) - v = v - ------------------ (self-assignment-removal) - discard "nop" + v = v + ------------------ (self-assignment-removal) + discard "nop" - x = y - ------------------ (copy) - `=copy`(x, y) + x = y + ------------------ (copy) + `=copy`(x, y) - f_sink(g()) - ----------------------- (call-to-sink) - f_sink(g()) + f_sink(g()) + ----------------------- (call-to-sink) + f_sink(g()) - f_sink(notLastReadOf y) - -------------------------- (copy-to-sink) - (let tmp; `=copy`(tmp, y); - f_sink(tmp)) + f_sink(notLastReadOf y) + -------------------------- (copy-to-sink) + (let tmp; `=copy`(tmp, y); + f_sink(tmp)) - f_sink(lastReadOf y) - ----------------------- (move-to-sink) - f_sink(y) - wasMoved(y) + f_sink(lastReadOf y) + ----------------------- (move-to-sink) + f_sink(y) + wasMoved(y) Object and array construction |