changeset 69:2ae98ac0f77f

Elements should be taken from the top of the worklist.
author Janus Dam Nielsen <janus.nielsen@alexandra.dk>
date Wed, 27 May 2009 13:46:32 +0200
parents 800d8d768d03
children acc2a8647905
files pysmcl/flow.py pysmcl/range_analysis.py
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/flow.py	Wed May 27 13:45:16 2009 +0200
+++ b/pysmcl/flow.py	Wed May 27 13:46:32 2009 +0200
@@ -36,9 +36,9 @@
 
     # main cycle
     while len(worklist) != 0:
-        x = worklist.pop()
+        x = worklist.pop(0)
 #        print "Working", x, x.parents
-        oldout = x.out_values[key]        
+        oldout = x.out_values[key]
         x.out_values[key] = combine(x, join(x.parents))
         if oldout != x.out_values[key]:
             for child in x.children:
--- a/pysmcl/range_analysis.py	Wed May 27 13:45:16 2009 +0200
+++ b/pysmcl/range_analysis.py	Wed May 27 13:46:32 2009 +0200
@@ -91,6 +91,9 @@
                     env[arg.id] = (0, self.prime)
                 return env
 
+            def visit_If(self, node):
+                return env
+
             def visit_Expr(self, node):
                 env['_'] = range(self.prime, node.value, env)
                 return env