[pypy-commit] pypy ssa-flow: clean up and kill dead code

rlamy noreply at buildbot.pypy.org
Thu Nov 13 01:31:40 CET 2014


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: ssa-flow
Changeset: r74494:8da7301b25d7
Date: 2014-11-12 23:49 +0000
http://bitbucket.org/pypy/pypy/changeset/8da7301b25d7/

Log:	clean up and kill dead code

diff --git a/rpython/annotator/test/test_annrpython.py b/rpython/annotator/test/test_annrpython.py
--- a/rpython/annotator/test/test_annrpython.py
+++ b/rpython/annotator/test/test_annrpython.py
@@ -14,7 +14,6 @@
 from rpython.rlib.rarithmetic import r_uint, base_int, r_longlong, r_ulonglong
 from rpython.rlib.rarithmetic import r_singlefloat
 from rpython.rlib import objectmodel
-from rpython.flowspace.objspace import build_flow
 from rpython.flowspace.flowcontext import FlowingError
 from rpython.flowspace.operation import op
 
@@ -53,17 +52,6 @@
                 self.translator.view()
             return s
 
-    def make_fun(self, func):
-        import inspect
-        try:
-            func = func.im_func
-        except AttributeError:
-            pass
-        name = func.func_name
-        funcgraph = build_flow(func)
-        funcgraph.source = inspect.getsource(func)
-        return funcgraph
-
     def test_simple_func(self):
         """
         one test source:
diff --git a/rpython/flowspace/test/test_generator.py b/rpython/flowspace/test/test_generator.py
--- a/rpython/flowspace/test/test_generator.py
+++ b/rpython/flowspace/test/test_generator.py
@@ -67,7 +67,7 @@
             yield n
             yield n
         #
-        graph = build_flow(func)
+        graph = make_generator_entry_graph(func)
         if option.view:
             graph.show()
         block = graph.startblock
diff --git a/rpython/translator/tool/make_dot.py b/rpython/translator/tool/make_dot.py
--- a/rpython/translator/tool/make_dot.py
+++ b/rpython/translator/tool/make_dot.py
@@ -1,7 +1,6 @@
 import os
 import inspect, linecache
 from rpython.flowspace.model import *
-from rpython.flowspace.objspace import build_flow
 from rpython.tool.udir import udir
 from py.process import cmdexec
 from rpython.tool.error import offset2lineno
@@ -238,14 +237,3 @@
     # not a keyword
     name = ''.join([CHAR_MAP[c] for c in name])
     return '_' + name
-
-
-if __name__ == '__main__':
-    def f(x):
-        i = 0
-        while i < x:
-            i += 1
-        return i
-
-    graph = build_flow(f)
-    make_dot('f', graph)


More information about the pypy-commit mailing list