Commit 07875147 authored by Richard Torenvliet's avatar Richard Torenvliet

Merge branch 'master' of github.com:taddeus/peephole

parents 6bd6ff45 d6c51e39
...@@ -36,7 +36,6 @@ class BasicBlock(Block): ...@@ -36,7 +36,6 @@ class BasicBlock(Block):
for s in reversed(self): for s in reversed(self):
for reg in s.get_def(): for reg in s.get_def():
if reg not in self_defs: if reg not in self_defs:
print 'Found def:', s
self_defs[reg] = s.sid self_defs[reg] = s.sid
self.gen_set.add(s.sid) self.gen_set.add(s.sid)
......
...@@ -124,17 +124,17 @@ class TestDataflow(unittest.TestCase): ...@@ -124,17 +124,17 @@ class TestDataflow(unittest.TestCase):
'$4': set([s4.sid]) '$4': set([s4.sid])
}) })
#def test_defs(self): def test_defs(self):
# s1 = S('command', 'add', '$3', '$1', '$2') s1 = S('command', 'add', '$3', '$1', '$2')
# s2 = S('command', 'move', '$1', '$3') s2 = S('command', 'move', '$1', '$3')
# s3 = S('command', 'move', '$3', '$2') s3 = S('command', 'move', '$3', '$2')
# s4 = S('command', 'li', '$4', '0x00000001') s4 = S('command', 'li', '$4', '0x00000001')
# block = B([s1, s2, s3, s4]) block = B([s1, s2, s3, s4])
# self.assertEqual(defs([block]), { self.assertEqual(defs([block]), {
# '$3': set([s1.sid, s3.sid]), '$3': set([s1.sid, s3.sid]),
# '$1': set([s2.sid]), '$1': set([s2.sid]),
# '$4': set([s4.sid]) '$4': set([s4.sid])
# }) })
def test_create_gen_kill_gen(self): def test_create_gen_kill_gen(self):
s1 = S('command', 'addu', '$3', '$1', '$2') s1 = S('command', 'addu', '$3', '$1', '$2')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment