[Cython] Dead code removal

Vitja Makarov vitja.makarov at gmail.com
Tue May 3 09:03:43 CEST 2011


Hi!

I can move unreachable code removal into its own branch and then make
a pull request.

But it seems to me that dead code removal should be done in control
flow analysis so there are few options:

1. remove unreachable code in control flow transformation
2. set is_terminator flag in control flow and then run removal
transformation later

For instance, RemoveUnreachableCode doesn't handle this case:

try:
    raise Error
finally:
    pass
print 'unreachable'

This case could be easily handled if I set is_terminator flag on the
whole TryFinallyStatNode,
but I'm not sure that this is the only unhandled case.

-- 
vitja.


More information about the cython-devel mailing list