[pypy-svn] pypy default: kill some dead old functions

cfbolz commits-noreply at bitbucket.org
Mon Apr 4 11:46:25 CEST 2011


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: 
Changeset: r43131:36bc5f74e90d
Date: 2011-04-01 21:58 +0200
http://bitbucket.org/pypy/pypy/changeset/36bc5f74e90d/

Log:	kill some dead old functions

diff --git a/pypy/translator/unsimplify.py b/pypy/translator/unsimplify.py
--- a/pypy/translator/unsimplify.py
+++ b/pypy/translator/unsimplify.py
@@ -115,46 +115,6 @@
     # in the second block!
     return split_block(annotator, block, 0, _forcelink=block.inputargs)
 
-def remove_direct_loops(annotator, graph):
-    """This is useful for code generators: it ensures that no link has
-    common input and output variables, which could occur if a block's exit
-    points back directly to the same block.  It allows code generators to be
-    simpler because they don't have to worry about overwriting input
-    variables when generating a sequence of assignments."""
-    def visit(link):
-        if isinstance(link, Link) and link.prevblock is link.target:
-            insert_empty_block(annotator, link)
-    traverse(visit, graph)
-
-def remove_double_links(annotator, graph):
-    """This can be useful for code generators: it ensures that no block has
-    more than one incoming links from one and the same other block. It allows
-    argument passing along links to be implemented with phi nodes since the
-    value of an argument can be determined by looking from which block the
-    control passed. """
-    def visit(block):
-        if isinstance(block, Block):
-            double_links = []
-            seen = {}
-            for link in block.exits:
-                if link.target in seen:
-                    double_links.append(link)
-                seen[link.target] = True
-            for link in double_links:
-                insert_empty_block(annotator, link)
-    traverse(visit, graph)
-
-def no_links_to_startblock(graph):
-    """Ensure no links to start block."""    
-    links_to_start_block = False
-    for block in graph.iterblocks():
-        for link in block.exits:
-            if link.target == graph.startblock:
-                links_to_start_block = True
-                break
-    if links_to_start_block:
-        insert_empty_startblock(None, graph)
-
 def call_initial_function(translator, initial_func, annhelper=None):
     """Before the program starts, call 'initial_func()'."""
     from pypy.annotation import model as annmodel


More information about the Pypy-commit mailing list