Commits

Ronan Lamy  committed bf9c913

Remove type_system argument from RPythonTyper.__init__

  • Participants
  • Parent commits 52c5500
  • Branches kill-typesystem

Comments (0)

Files changed (24)

File rpython/jit/backend/test/support.py

 
         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)

File rpython/jit/codewriter/codewriter.py

         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)

File rpython/jit/codewriter/support.py

     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():
     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)

File rpython/jit/codewriter/test/test_flatten.py

 class FakeCPU:
     class tracker:
         pass
-    
+
     def __init__(self, rtyper):
         rtyper._builtin_func_for_spec_cache = FakeDict()
         self.rtyper = rtyper
 
 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,

File rpython/jit/codewriter/test/test_regalloc.py

 
 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,

File rpython/jit/metainterp/test/support.py

         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
 
     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

File rpython/jit/metainterp/test/test_virtualref.py

             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])

File rpython/rtyper/test/test_llinterp.py

     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)
         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)
             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

File rpython/rtyper/test/test_rlist.py

 
         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]
 
         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]

File rpython/rtyper/test/test_rtuple.py

 
         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]

File rpython/rtyper/test/tool.py

 
     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):

File rpython/translator/backendopt/test/test_all.py

     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)
 
         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

File rpython/translator/backendopt/test/test_canraise.py

     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)

File rpython/translator/backendopt/test/test_finalizer.py

             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:

File rpython/translator/backendopt/test/test_inline.py

     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,

File rpython/translator/backendopt/test/test_malloc.py

         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

File rpython/translator/backendopt/test/test_mallocv.py

         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()

File rpython/translator/backendopt/test/test_storesink.py

     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):

File rpython/translator/backendopt/test/test_writeanalyze.py

     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)

File rpython/translator/driver.py

     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")

File rpython/translator/test/test_exceptiontransform.py

     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:
             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)
             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)
             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)

File rpython/translator/test/test_simplify.py

         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()

File rpython/translator/test/test_unsimplify.py

     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():

File rpython/translator/translator.py

         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):