Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
peephole
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
peephole
Commits
07875147
Commit
07875147
authored
Dec 29, 2011
by
Richard Torenvliet
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:taddeus/peephole
parents
6bd6ff45
d6c51e39
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
src/dataflow.py
src/dataflow.py
+0
-1
tests/test_dataflow.py
tests/test_dataflow.py
+11
-11
No files found.
src/dataflow.py
View file @
07875147
...
...
@@ -36,7 +36,6 @@ class BasicBlock(Block):
for
s
in
reversed
(
self
):
for
reg
in
s
.
get_def
():
if
reg
not
in
self_defs
:
print
'Found def:'
,
s
self_defs
[
reg
]
=
s
.
sid
self
.
gen_set
.
add
(
s
.
sid
)
...
...
tests/test_dataflow.py
View file @
07875147
...
...
@@ -124,17 +124,17 @@ class TestDataflow(unittest.TestCase):
'$4'
:
set
([
s4
.
sid
])
})
#
def test_defs(self):
#
s1 = S('command', 'add', '$3', '$1', '$2')
#
s2 = S('command', 'move', '$1', '$3')
#
s3 = S('command', 'move', '$3', '$2')
#
s4 = S('command', 'li', '$4', '0x00000001')
#
block = B([s1, s2, s3, s4])
#
self.assertEqual(defs([block]), {
#
'$3': set([s1.sid, s3.sid]),
#
'$1': set([s2.sid]),
#
'$4': set([s4.sid])
#
})
def
test_defs
(
self
):
s1
=
S
(
'command'
,
'add'
,
'$3'
,
'$1'
,
'$2'
)
s2
=
S
(
'command'
,
'move'
,
'$1'
,
'$3'
)
s3
=
S
(
'command'
,
'move'
,
'$3'
,
'$2'
)
s4
=
S
(
'command'
,
'li'
,
'$4'
,
'0x00000001'
)
block
=
B
([
s1
,
s2
,
s3
,
s4
])
self
.
assertEqual
(
defs
([
block
]),
{
'$3'
:
set
([
s1
.
sid
,
s3
.
sid
]),
'$1'
:
set
([
s2
.
sid
]),
'$4'
:
set
([
s4
.
sid
])
})
def
test_create_gen_kill_gen
(
self
):
s1
=
S
(
'command'
,
'addu'
,
'$3'
,
'$1'
,
'$2'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment