Author: Ronan Lamy <[email protected]>
Branch: kill-typesystem
Changeset: r65743:bf9c9135b763
Date: 2013-07-28 13:04 +0100
http://bitbucket.org/pypy/pypy/changeset/bf9c9135b763/

Log:    Remove type_system argument from RPythonTyper.__init__

diff --git a/rpython/jit/backend/test/support.py 
b/rpython/jit/backend/test/support.py
--- a/rpython/jit/backend/test/support.py
+++ b/rpython/jit/backend/test/support.py
@@ -59,7 +59,7 @@
 
         t.buildannotator().build_types(function, [int] * len(args),
                                        main_entry_point=True)
-        t.buildrtyper(type_system=self.type_system).specialize()
+        t.buildrtyper().specialize()
         warmrunnerdesc = WarmRunnerDesc(t, translate_support_code=True,
                                         CPUClass=self.CPUClass,
                                         **kwds)
diff --git a/rpython/jit/codewriter/codewriter.py 
b/rpython/jit/codewriter/codewriter.py
--- a/rpython/jit/codewriter/codewriter.py
+++ b/rpython/jit/codewriter/codewriter.py
@@ -21,9 +21,9 @@
         self.callcontrol = CallControl(cpu, jitdrivers_sd)
         self._seen_files = set()
 
-    def transform_func_to_jitcode(self, func, values, type_system='lltype'):
+    def transform_func_to_jitcode(self, func, values):
         """For testing."""
-        rtyper = support.annotate(func, values, type_system=type_system)
+        rtyper = support.annotate(func, values)
         graph = rtyper.annotator.translator.graphs[0]
         jitcode = JitCode("test")
         self.transform_graph_to_jitcode(graph, jitcode, True)
diff --git a/rpython/jit/codewriter/support.py 
b/rpython/jit/codewriter/support.py
--- a/rpython/jit/codewriter/support.py
+++ b/rpython/jit/codewriter/support.py
@@ -34,7 +34,7 @@
     return a.typeannotation(t)
 
 def annotate(func, values, inline=None, backendoptimize=True,
-             type_system="lltype", translationoptions={}):
+             translationoptions={}):
     # build the normal ll graphs for ll_function
     t = TranslationContext()
     for key, value in translationoptions.items():
@@ -43,7 +43,7 @@
     a = t.buildannotator(policy=annpolicy)
     argtypes = getargtypes(a, values)
     a.build_types(func, argtypes, main_entry_point=True)
-    rtyper = t.buildrtyper(type_system = type_system)
+    rtyper = t.buildrtyper()
     rtyper.specialize()
     #if inline:
     #    auto_inlining(t, threshold=inline)
diff --git a/rpython/jit/codewriter/test/test_flatten.py 
b/rpython/jit/codewriter/test/test_flatten.py
--- a/rpython/jit/codewriter/test/test_flatten.py
+++ b/rpython/jit/codewriter/test/test_flatten.py
@@ -49,7 +49,7 @@
 class FakeCPU:
     class tracker:
         pass
-    
+
     def __init__(self, rtyper):
         rtyper._builtin_func_for_spec_cache = FakeDict()
         self.rtyper = rtyper
@@ -123,8 +123,8 @@
 
 class TestFlatten:
 
-    def make_graphs(self, func, values, type_system='lltype'):
-        self.rtyper = support.annotate(func, values, type_system=type_system)
+    def make_graphs(self, func, values):
+        self.rtyper = support.annotate(func, values)
         return self.rtyper.annotator.translator.graphs
 
     def encoding_test(self, func, args, expected,
diff --git a/rpython/jit/codewriter/test/test_regalloc.py 
b/rpython/jit/codewriter/test/test_regalloc.py
--- a/rpython/jit/codewriter/test/test_regalloc.py
+++ b/rpython/jit/codewriter/test/test_regalloc.py
@@ -13,8 +13,8 @@
 
 class TestRegAlloc:
 
-    def make_graphs(self, func, values, type_system='lltype'):
-        self.rtyper = support.annotate(func, values, type_system=type_system)
+    def make_graphs(self, func, values):
+        self.rtyper = support.annotate(func, values)
         return self.rtyper.annotator.translator.graphs
 
     def check_assembler(self, graph, expected, transform=False,
diff --git a/rpython/jit/metainterp/test/support.py 
b/rpython/jit/metainterp/test/support.py
--- a/rpython/jit/metainterp/test/support.py
+++ b/rpython/jit/metainterp/test/support.py
@@ -50,7 +50,7 @@
         FakeWarmRunnerState.enable_opts = {}
 
     func._jit_unroll_safe_ = True
-    rtyper = support.annotate(func, values, type_system=type_system,
+    rtyper = support.annotate(func, values,
                               translationoptions=translationoptions)
     graphs = rtyper.annotator.translator.graphs
     testself.all_graphs = graphs
@@ -210,7 +210,7 @@
 
     def interp_operations(self, f, args, **kwds):
         # get the JitCodes for the function f
-        _get_jitcodes(self, self.CPUClass, f, args, self.type_system, **kwds)
+        _get_jitcodes(self, self.CPUClass, f, args, **kwds)
         # try to run it with blackhole.py
         result1 = _run_with_blackhole(self, args)
         # try to run it with pyjitpl.py
diff --git a/rpython/jit/metainterp/test/test_virtualref.py 
b/rpython/jit/metainterp/test/test_virtualref.py
--- a/rpython/jit/metainterp/test/test_virtualref.py
+++ b/rpython/jit/metainterp/test/test_virtualref.py
@@ -27,7 +27,7 @@
             x1 = vref()                  # jit_force_virtual
             virtual_ref_finish(vref, x)
         #
-        _get_jitcodes(self, self.CPUClass, fn, [], self.type_system)
+        _get_jitcodes(self, self.CPUClass, fn, [])
         graph = self.all_graphs[0]
         assert graph.name == 'fn'
         self.vrefinfo.replace_force_virtual_with_call([graph])
diff --git a/rpython/rtyper/test/test_llinterp.py 
b/rpython/rtyper/test/test_llinterp.py
--- a/rpython/rtyper/test/test_llinterp.py
+++ b/rpython/rtyper/test/test_llinterp.py
@@ -36,8 +36,7 @@
     return res
 
 def gengraph(func, argtypes=[], viewbefore='auto', policy=None,
-             type_system="lltype", backendopt=False, config=None,
-             **extraconfigopts):
+             backendopt=False, config=None, **extraconfigopts):
     t = TranslationContext(config=config)
     t.config.set(**extraconfigopts)
     a = t.buildannotator(policy=policy)
@@ -48,7 +47,7 @@
         a.simplify()
         t.view()
     global typer # we need it for find_exception
-    typer = t.buildrtyper(type_system=type_system)
+    typer = t.buildrtyper()
     timelog("rtyper-specializing", typer.specialize)
     #t.view()
     timelog("checking graphs", t.checkgraphs)
@@ -88,9 +87,8 @@
             policy = AnnotatorPolicy()
 
         t, typer, graph = gengraph(func, [annotation(x) for x in values],
-                                   viewbefore, policy, type_system=type_system,
-                                   backendopt=backendopt, config=config,
-                                   **extraconfigopts)
+                                   viewbefore, policy, backendopt=backendopt,
+                                   config=config, **extraconfigopts)
         interp = LLInterpreter(typer)
         _tcache[key] = (t, interp, graph)
         # keep the cache small
diff --git a/rpython/rtyper/test/test_rlist.py 
b/rpython/rtyper/test/test_rlist.py
--- a/rpython/rtyper/test/test_rlist.py
+++ b/rpython/rtyper/test/test_rlist.py
@@ -1439,7 +1439,7 @@
 
         t = TranslationContext()
         s = t.buildannotator().build_types(f, [])
-        rtyper = t.buildrtyper(type_system=self.type_system)
+        rtyper = t.buildrtyper()
         rtyper.specialize()
 
         s_A_list = s.items[0]
@@ -1467,7 +1467,7 @@
 
         t = TranslationContext()
         s = t.buildannotator().build_types(f, [])
-        rtyper = t.buildrtyper(type_system=self.type_system)
+        rtyper = t.buildrtyper()
         rtyper.specialize()
 
         s_A_list = s.items[0]
diff --git a/rpython/rtyper/test/test_rtuple.py 
b/rpython/rtyper/test/test_rtuple.py
--- a/rpython/rtyper/test/test_rtuple.py
+++ b/rpython/rtyper/test/test_rtuple.py
@@ -159,7 +159,7 @@
 
         t = TranslationContext()
         s = t.buildannotator().build_types(f, [])
-        rtyper = t.buildrtyper(type_system=self.type_system)
+        rtyper = t.buildrtyper()
         rtyper.specialize()
 
         s_AB_tup = s.items[0]
diff --git a/rpython/rtyper/test/tool.py b/rpython/rtyper/test/tool.py
--- a/rpython/rtyper/test/tool.py
+++ b/rpython/rtyper/test/tool.py
@@ -8,7 +8,7 @@
 
     def gengraph(self, func, argtypes=[], viewbefore='auto', policy=None,
              backendopt=False, config=None):
-        return gengraph(func, argtypes, viewbefore, policy, 
type_system=self.type_system,
+        return gengraph(func, argtypes, viewbefore, policy,
                         backendopt=backendopt, config=config)
 
     def interpret(self, fn, args, **kwds):
diff --git a/rpython/translator/backendopt/test/test_all.py 
b/rpython/translator/backendopt/test/test_all.py
--- a/rpython/translator/backendopt/test/test_all.py
+++ b/rpython/translator/backendopt/test/test_all.py
@@ -48,7 +48,7 @@
     def translateopt(self, func, sig, **optflags):
         t = TranslationContext()
         t.buildannotator().build_types(func, sig)
-        t.buildrtyper(type_system=self.type_system).specialize()
+        t.buildrtyper().specialize()
         if option.view:
             t.view()
         backend_optimizations(t, **optflags)
@@ -265,7 +265,7 @@
 
         t = TranslationContext()
         t.buildannotator().build_types(main, [int])
-        t.buildrtyper(type_system='lltype').specialize()
+        t.buildrtyper().specialize()
         exctransformer = t.getexceptiontransformer()
         exctransformer.create_exception_handling(graphof(t, common))
         from rpython.annotator import model as annmodel
diff --git a/rpython/translator/backendopt/test/test_canraise.py 
b/rpython/translator/backendopt/test/test_canraise.py
--- a/rpython/translator/backendopt/test/test_canraise.py
+++ b/rpython/translator/backendopt/test/test_canraise.py
@@ -7,7 +7,7 @@
     def translate(self, func, sig):
         t = TranslationContext()
         t.buildannotator().build_types(func, sig)
-        t.buildrtyper(type_system='lltype').specialize()
+        t.buildrtyper().specialize()
         if option.view:
             t.view()
         return t, RaiseAnalyzer(t)
diff --git a/rpython/translator/backendopt/test/test_finalizer.py 
b/rpython/translator/backendopt/test/test_finalizer.py
--- a/rpython/translator/backendopt/test/test_finalizer.py
+++ b/rpython/translator/backendopt/test/test_finalizer.py
@@ -19,7 +19,7 @@
             func_to_analyze = func
         t = TranslationContext()
         t.buildannotator().build_types(func, sig)
-        t.buildrtyper(type_system='lltype').specialize()
+        t.buildrtyper().specialize()
         if backendopt:
             backend_optimizations(t)
         if option.view:
diff --git a/rpython/translator/backendopt/test/test_inline.py 
b/rpython/translator/backendopt/test/test_inline.py
--- a/rpython/translator/backendopt/test/test_inline.py
+++ b/rpython/translator/backendopt/test/test_inline.py
@@ -52,7 +52,7 @@
     def translate(self, func, argtypes):
         t = TranslationContext()
         t.buildannotator().build_types(func, argtypes)
-        t.buildrtyper(type_system=self.type_system).specialize()
+        t.buildrtyper().specialize()
         return t
 
     def check_inline(self, func, in_func, sig, entry=None,
diff --git a/rpython/translator/backendopt/test/test_malloc.py 
b/rpython/translator/backendopt/test/test_malloc.py
--- a/rpython/translator/backendopt/test/test_malloc.py
+++ b/rpython/translator/backendopt/test/test_malloc.py
@@ -34,7 +34,7 @@
         remover = self.MallocRemover()
         t = TranslationContext()
         t.buildannotator().build_types(fn, signature)
-        t.buildrtyper(type_system='lltype').specialize()
+        t.buildrtyper().specialize()
         graph = graphof(t, fn)
         if inline is not None:
             from rpython.translator.backendopt.inline import auto_inline_graphs
diff --git a/rpython/translator/backendopt/test/test_mallocv.py 
b/rpython/translator/backendopt/test/test_mallocv.py
--- a/rpython/translator/backendopt/test/test_mallocv.py
+++ b/rpython/translator/backendopt/test/test_mallocv.py
@@ -37,7 +37,7 @@
         t = TranslationContext()
         self.translator = t
         t.buildannotator().build_types(fn, signature)
-        t.buildrtyper(type_system=self.type_system).specialize()
+        t.buildrtyper().specialize()
         graph = graphof(t, fn)
         if option.view:
             t.view()
diff --git a/rpython/translator/backendopt/test/test_storesink.py 
b/rpython/translator/backendopt/test/test_storesink.py
--- a/rpython/translator/backendopt/test/test_storesink.py
+++ b/rpython/translator/backendopt/test/test_storesink.py
@@ -12,7 +12,7 @@
     def translate(self, func, argtypes):
         t = TranslationContext()
         t.buildannotator().build_types(func, argtypes)
-        t.buildrtyper(type_system=self.type_system).specialize()
+        t.buildrtyper().specialize()
         return t
 
     def check(self, f, argtypes, no_getfields=0):
diff --git a/rpython/translator/backendopt/test/test_writeanalyze.py 
b/rpython/translator/backendopt/test/test_writeanalyze.py
--- a/rpython/translator/backendopt/test/test_writeanalyze.py
+++ b/rpython/translator/backendopt/test/test_writeanalyze.py
@@ -14,7 +14,7 @@
     def translate(self, func, sig):
         t = TranslationContext()
         t.buildannotator().build_types(func, sig)
-        t.buildrtyper(type_system=self.type_system).specialize()
+        t.buildrtyper().specialize()
         if option.view:
             t.view()
         return t, self.Analyzer(t)
diff --git a/rpython/translator/driver.py b/rpython/translator/driver.py
--- a/rpython/translator/driver.py
+++ b/rpython/translator/driver.py
@@ -346,7 +346,7 @@
     def task_rtype_lltype(self):
         """ RTyping - lltype version
         """
-        rtyper = self.translator.buildrtyper(type_system='lltype')
+        rtyper = self.translator.buildrtyper()
         rtyper.specialize(dont_simplify_again=True)
 
     @taskdef([RTYPE], "JIT compiler generation")
diff --git a/rpython/translator/test/test_exceptiontransform.py 
b/rpython/translator/test/test_exceptiontransform.py
--- a/rpython/translator/test/test_exceptiontransform.py
+++ b/rpython/translator/test/test_exceptiontransform.py
@@ -36,7 +36,7 @@
     def transform_func(self, fn, inputtypes, backendopt=False):
         t = TranslationContext()
         t.buildannotator().build_types(fn, inputtypes)
-        t.buildrtyper(type_system=self.type_system).specialize()
+        t.buildrtyper().specialize()
         if option.view:
             t.view()
         if backendopt:
@@ -158,7 +158,7 @@
             return x + 1
         t = TranslationContext()
         t.buildannotator().build_types(f, [int])
-        t.buildrtyper(type_system=self.type_system).specialize()
+        t.buildrtyper().specialize()
         g = graphof(t, f)
         etrafo = exceptiontransform.ExceptionTransformer(t)
         etrafo.create_exception_handling(g)
@@ -170,7 +170,7 @@
             raise ValueError
         t = TranslationContext()
         t.buildannotator().build_types(f, [int])
-        t.buildrtyper(type_system=self.type_system).specialize()
+        t.buildrtyper().specialize()
         g = graphof(t, f)
         etrafo = exceptiontransform.ExceptionTransformer(t)
         etrafo.create_exception_handling(g)
@@ -233,7 +233,7 @@
             return s.x
         t = TranslationContext()
         t.buildannotator().build_types(f, [int])
-        t.buildrtyper(type_system=self.type_system).specialize()
+        t.buildrtyper().specialize()
         g = graphof(t, f)
         etrafo = exceptiontransform.ExceptionTransformer(t)
         etrafo.create_exception_handling(g)
diff --git a/rpython/translator/test/test_simplify.py 
b/rpython/translator/test/test_simplify.py
--- a/rpython/translator/test/test_simplify.py
+++ b/rpython/translator/test/test_simplify.py
@@ -335,7 +335,7 @@
         t.buildannotator().build_types(func, argtypes)
         if option.view:
             t.view()
-        t.buildrtyper(self.typesystem).specialize()
+        t.buildrtyper().specialize()
         backend_optimizations(t)
         if option.view:
             t.view()
diff --git a/rpython/translator/test/test_unsimplify.py 
b/rpython/translator/test/test_unsimplify.py
--- a/rpython/translator/test/test_unsimplify.py
+++ b/rpython/translator/test/test_unsimplify.py
@@ -11,7 +11,7 @@
     t = TranslationContext()
     t.buildannotator().build_types(func, argtypes)
     t.entry_point_graph = graphof(t, func)
-    t.buildrtyper(type_system=type_system).specialize()
+    t.buildrtyper().specialize()
     return graphof(t, func), t
 
 def test_split_blocks_simple():
diff --git a/rpython/translator/translator.py b/rpython/translator/translator.py
--- a/rpython/translator/translator.py
+++ b/rpython/translator/translator.py
@@ -74,14 +74,13 @@
         self.annotator = RPythonAnnotator(self, policy=policy)
         return self.annotator
 
-    def buildrtyper(self, type_system="lltype"):
+    def buildrtyper(self):
         if self.annotator is None:
             raise ValueError("no annotator")
         if self.rtyper is not None:
             raise ValueError("we already have an rtyper")
         from rpython.rtyper.rtyper import RPythonTyper
-        self.rtyper = RPythonTyper(self.annotator,
-                                   type_system=type_system)
+        self.rtyper = RPythonTyper(self.annotator)
         return self.rtyper
 
     def getexceptiontransformer(self):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to