[pypy-svn] r7230 - pypy/trunk/src/pypy/translator

hpk at codespeak.net hpk at codespeak.net
Mon Nov 15 10:48:16 CET 2004


Author: hpk
Date: Mon Nov 15 10:48:15 2004
New Revision: 7230

Modified:
   pypy/trunk/src/pypy/translator/simplify.py
   pypy/trunk/src/pypy/translator/translator.py
Log:
don't return the graph for inplace-operations 
but return None. 
(the functions in simplify.py modify the graph
inplace) 



Modified: pypy/trunk/src/pypy/translator/simplify.py
==============================================================================
--- pypy/trunk/src/pypy/translator/simplify.py	(original)
+++ pypy/trunk/src/pypy/translator/simplify.py	Mon Nov 15 10:48:15 2004
@@ -81,14 +81,12 @@
     traverse(visit, graph)
 
 def simplify_graph(graph):
-    """Apply all the existing optimisations to the graph."""
+    """inplace-apply all the existing optimisations to the graph."""
     checkgraph(graph)
     eliminate_empty_blocks(graph)
     remove_implicit_exceptions(graph)
     join_blocks(graph)
     checkgraph(graph)
-    return graph
-
 
 def remove_direct_loops(graph):
     """This is useful for code generators: it ensures that no link has

Modified: pypy/trunk/src/pypy/translator/translator.py
==============================================================================
--- pypy/trunk/src/pypy/translator/translator.py	(original)
+++ pypy/trunk/src/pypy/translator/translator.py	Mon Nov 15 10:48:15 2004
@@ -73,7 +73,7 @@
             space = FlowObjSpace()
             graph = space.build_flow(func)
             if self.simplifying:
-                graph = simplify_graph(graph)
+                simplify_graph(graph)
             self.flowgraphs[func] = graph
             self.functions.append(func)
             try:
@@ -115,7 +115,7 @@
                 self.simplify(func)
         else:
             graph = self.getflowgraph(func)
-            self.flowgraphs[func] = simplify_graph(graph)
+            simplify_graph(graph)
 
     def annotate(self, input_args_types, func=None):
         """annotate(self, input_arg_types[, func]) -> Annotator



More information about the Pypy-commit mailing list