[pypy-commit] pypy translation-cleanup: FlowObjSpace ctor doesn't take a config argument any more
rlamy
noreply at buildbot.pypy.org
Sat Sep 29 01:09:35 CEST 2012
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: translation-cleanup
Changeset: r57642:8f322463a118
Date: 2012-09-29 00:09 +0100
http://bitbucket.org/pypy/pypy/changeset/8f322463a118/
Log: FlowObjSpace ctor doesn't take a config argument any more
diff --git a/pypy/objspace/flow/objspace.py b/pypy/objspace/flow/objspace.py
--- a/pypy/objspace/flow/objspace.py
+++ b/pypy/objspace/flow/objspace.py
@@ -44,7 +44,7 @@
the space operations that the interpreter generates when it interprets
(the bytecode of) some function.
"""
- def __init__(self, config=None):
+ def __init__(self):
self.w_None = Constant(None)
self.builtin = Constant(__builtin__)
self.sys = Constant(sys)
diff --git a/pypy/translator/translator.py b/pypy/translator/translator.py
--- a/pypy/translator/translator.py
+++ b/pypy/translator/translator.py
@@ -8,6 +8,7 @@
from pypy.translator import simplify
from pypy.objspace.flow.model import FunctionGraph, checkgraph, Block
+from pypy.objspace.flow.objspace import FlowObjSpace
from pypy.tool.ansi_print import ansi_log
from pypy.tool.sourcetools import nice_repr_for_func
from pypy.config.pypyoption import pypy_optiondescription
@@ -35,7 +36,6 @@
setattr(config.translation, attr, flowing_flags[attr])
self.config = config
self.platform = get_platform(config)
- self.create_flowspace_config()
self.annotator = None
self.rtyper = None
self.exceptiontransformer = None
@@ -43,17 +43,6 @@
self.callgraph = {} # {opaque_tag: (caller-graph, callee-graph)}
self._prebuilt_graphs = {} # only used by the pygame viewer
- def create_flowspace_config(self):
- # XXX this is a hack: we create a new config, which is only used
- # for the flow object space. The problem is that the flow obj space
- # needs an objspace config, but the thing we are translating might not
- # have one (or worse we are translating pypy and the flow space picks
- # up strange options of the pypy we are translating). Therefore we need
- # to construct this new config
- self.flowconfig = get_combined_translation_config(
- pypy_optiondescription, self.config, translating=True)
- self.flowconfig.objspace.name = "flow"
-
def buildflowgraph(self, func, mute_dot=False):
"""Get the flow graph for a function."""
if not isinstance(func, types.FunctionType):
@@ -64,8 +53,7 @@
else:
if self.config.translation.verbose:
log.start(nice_repr_for_func(func))
- from pypy.objspace.flow.objspace import FlowObjSpace
- space = FlowObjSpace(self.flowconfig)
+ space = FlowObjSpace()
graph = space.build_flow(func)
if self.config.translation.simplifying:
simplify.simplify_graph(graph)
More information about the pypy-commit
mailing list