GNOME Bugzilla – Bug 662054
rewrite.py: add basic variable lifetime tracking
Last modified: 2011-10-23 18:59:45 UTC
I'm a little conflicted about this patch: * It's handles one important case - repeated uses of build UncopyableThing() as u: u.do_something() * It's pretty sound theoretically, and has full test cases. * But it's 200 lines of code to handle that one important case, which probably could have been handled with a 20 line hack. Maybe some of the other cases it handles will come up in the future...
Created attachment 199287 [details] [review] rewrite.py: add basic variable lifetime tracking Track when a variable is overwritten with a new value in a statement before it is mutated. In this case, we don't need to copy the pre-statement value.
Attachment 199287 [details] pushed as bfcc9e1 - rewrite.py: add basic variable lifetime tracking