Reintroduced dead code elimination to CFA pass to avoid dataflow problems. Updated tests.
This commit is contained in:
parent
c5d95e01e1
commit
c06f811473
3 changed files with 22 additions and 15 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue