aboutsummaryrefslogtreecommitdiff
path: root/devtools/tasmrecover/tasm/proc.py
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2011-06-16 16:43:48 +0200
committerWillem Jan Palenstijn2011-06-16 16:43:48 +0200
commitae67a9a958e26a237ddb7910f6c4a1b6b088dc77 (patch)
tree6141a87a2d78901a61a5e5ad98aac390307ca40f /devtools/tasmrecover/tasm/proc.py
parent2c76a4af40fdafecd5191c55b3d54b204022c13b (diff)
downloadscummvm-rg350-ae67a9a958e26a237ddb7910f6c4a1b6b088dc77.tar.gz
scummvm-rg350-ae67a9a958e26a237ddb7910f6c4a1b6b088dc77.tar.bz2
scummvm-rg350-ae67a9a958e26a237ddb7910f6c4a1b6b088dc77.zip
DREAMWEB: Re-optimize unbounded code blocks
This gets rid of some unused labels. We need to be careful not be optimize too much, as that could remove the very label the unbounded block was added for.
Diffstat (limited to 'devtools/tasmrecover/tasm/proc.py')
-rw-r--r--devtools/tasmrecover/tasm/proc.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/devtools/tasmrecover/tasm/proc.py b/devtools/tasmrecover/tasm/proc.py
index e5af1afae5..6db3b7a682 100644
--- a/devtools/tasmrecover/tasm/proc.py
+++ b/devtools/tasmrecover/tasm/proc.py
@@ -66,7 +66,7 @@ class proc:
i += 1
return
- def optimize(self):
+ def optimize(self, keep_labels=[]):
print "optimizing..."
#trivial simplifications
while len(self.stmts) and isinstance(self.stmts[-1], op.label):
@@ -109,7 +109,7 @@ class proc:
if not isinstance(s, op.label):
continue
print "checking label %s..." %s.name
- used = False
+ used = s.name in keep_labels
if s.name not in self.retlabels:
for j in self.stmts:
if isinstance(j, op.basejmp) and j.label == s.name: