[Patches] [ python-Patches-1346214 ] Better dead code elimination for the AST compiler
SourceForge.net
noreply at sourceforge.net
Sun Jun 4 08:07:28 CEST 2006
Patches item #1346214, was opened at 2005-11-02 10:21
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1346214&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Parser/Compiler
Group: Python 2.5
Status: Open
>Resolution: Accepted
Priority: 5
Submitted By: Rune Holm (titanstar)
>Assigned to: Georg Brandl (gbrandl)
Summary: Better dead code elimination for the AST compiler
Initial Comment:
Here's a patch that adds dead code elimination for if
0: style statements, and improves the current dead code
elimination for while statements by not performing
elimination if the function is a generator. If the
last yield statement from a generator is removed, the
generator is turned into a regular function, which
changes the semantics of the function.
----------------------------------------------------------------------
>Comment By: Neal Norwitz (nnorwitz)
Date: 2006-06-03 23:07
Message:
Logged In: YES
user_id=33168
It would be nice to make a #define for the error message so
they don't get out of sync. I wouldn't mind seeing the
variable name spelled out, ste_returns_value or something
like that.
I didn't look closely at the line numbers and verify the
changes were correct.
----------------------------------------------------------------------
Comment By: Brett Cannon (bcannon)
Date: 2006-06-03 16:51
Message:
Logged In: YES
user_id=357491
Replied on python-dev, but for thoroughness, the patch looks
fine from looking at the patch file itself. Apply the
'return' detection on its own, though, for better tracking
of changes and easier rollback if something does go bad.
----------------------------------------------------------------------
Comment By: Georg Brandl (gbrandl)
Date: 2006-05-26 04:34
Message:
Logged In: YES
user_id=849994
Attaching new patch which does elimination for if 0, if 1
and if __debug__ correctly (visiting else clauses!) and
correctly recognizes functions mixing "return x" and "yield".
----------------------------------------------------------------------
Comment By: Rune Holm (titanstar)
Date: 2005-11-06 12:41
Message:
Logged In: YES
user_id=858364
Sorry, I'm new to the sourceforge patch tracker. The patch should be
attached now.
----------------------------------------------------------------------
Comment By: Simon Dahlbacka (sdahlbac)
Date: 2005-11-06 11:08
Message:
Logged In: YES
user_id=750513
the actual patch is missing..
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1346214&group_id=5470
More information about the Patches
mailing list