Commits

Anonymous committed 5bb57cd

Documentation enhancements.

Comments (0)

Files changed (2)

pypy/translator/simplify.py

+"""Flow Graph Simplification
 """
-generate Pyrex files from the flowmodel. 
 
-"""
 from pypy.objspace.flow.model import *
 
-# debug
-from pypy.translator.genpyrex import GenPyrex
-
-
 def eliminate_empty_blocks(graph):
     """Eliminate basic blocks that do not contain any operations.
     When this happens, we need to replace the preceeding link with the
     traverse(visit, graph)
 
 def simplify_graph(graph):
-    """apply all the existing optimisations to the graph"""
+    """Apply all the existing optimisations to the graph."""
     eliminate_empty_blocks(graph)
     join_blocks(graph)
     return graph

pypy/translator/transform.py

-"""Peephole Flow Graph Transformation
+"""Flow Graph Transformation
+
+The difference between simplification and transformation is that
+transformation may introduce new space operation.
 """
 
 import autopath
 # --> d = alloc_and_set(c, a)
 
 def transform_allocate(self):
+    """Transforms [a] * b to alloc_and_set(b, a) where b is int."""
     for block, ann in self.annotated.iteritems():
         operations = block.operations[:]
         n_op = len(operations)
 # --> e = getslice(d, a, b)
 
 def transform_slice(self):
+    """Transforms a[b:c] to getslice(a, b, c)."""
     for block, ann in self.annotated.iteritems():
         operations = block.operations[:]
         n_op = len(operations)
                 block.operations[i:i+2] = [new_op]
 
 def transform_graph(ann):
+    """Apply set of transformations available."""
     transform_allocate(ann)
     transform_slice(ann)