Reintroduced dead code elimination to CFA pass to avoid dataflow problems. Updated tests.

This commit is contained in:
Jon Riehl 2013-05-16 15:38:12 -05:00
commit c06f811473
3 changed files with 22 additions and 15 deletions

View file

@ -31,12 +31,12 @@ class ControlFlowGraph (object):
def unlink_unreachables (self):
changed = True
next_blocks = self.blocks.keys()
next_blocks = set(self.blocks.keys())
next_blocks.remove(0)
while changed:
changed = False
blocks = next_blocks
next_blocks = blocks[:]
next_blocks = blocks.copy()
for block in blocks:
if len(self.blocks_in[block]) == 0:
blocks_out = self.blocks_out[block]