Author: Ronan Lamy <[email protected]>
Branch: type_system-cleanup
Changeset: r80070:de1316b4c1c4
Date: 2015-10-09 00:51 +0100
http://bitbucket.org/pypy/pypy/changeset/de1316b4c1c4/

Log:    Kill LowLevelTypeSystem

diff --git a/rpython/jit/codewriter/call.py b/rpython/jit/codewriter/call.py
--- a/rpython/jit/codewriter/call.py
+++ b/rpython/jit/codewriter/call.py
@@ -178,7 +178,6 @@
         """
         fnptr = getfunctionptr(graph)
         FUNC = lltype.typeOf(fnptr).TO
-        assert self.rtyper.type_system.name == "lltypesystem"
         fnaddr = llmemory.cast_ptr_to_adr(fnptr)
         NON_VOID_ARGS = [ARG for ARG in FUNC.ARGS if ARG is not lltype.Void]
         calldescr = self.cpu.calldescrof(FUNC, tuple(NON_VOID_ARGS),
diff --git a/rpython/jit/codewriter/test/test_call.py 
b/rpython/jit/codewriter/test/test_call.py
--- a/rpython/jit/codewriter/test/test_call.py
+++ b/rpython/jit/codewriter/test/test_call.py
@@ -159,8 +159,6 @@
     class FakeRTyper:
         class annotator:
             translator = None
-        class type_system:
-            name = 'lltypesystem'
 
     def getfunctionptr(graph):
         F = lltype.FuncType([], lltype.Signed)
diff --git a/rpython/jit/codewriter/test/test_jtransform.py 
b/rpython/jit/codewriter/test/test_jtransform.py
--- a/rpython/jit/codewriter/test/test_jtransform.py
+++ b/rpython/jit/codewriter/test/test_jtransform.py
@@ -30,7 +30,6 @@
     return Constant(x, lltype.typeOf(x))
 
 class FakeRTyper:
-    class type_system: name = 'lltypesystem'
     instance_reprs = {}
 
 class FakeCPU:
diff --git a/rpython/rtyper/rtyper.py b/rpython/rtyper/rtyper.py
--- a/rpython/rtyper/rtyper.py
+++ b/rpython/rtyper/rtyper.py
@@ -25,7 +25,7 @@
     Ptr, ContainerType, FuncType, functionptr, typeOf, RuntimeTypeInfo,
     attachRuntimeTypeInfo, Primitive)
 from rpython.rtyper.rmodel import Repr, inputconst, BrokenReprTyperError
-from rpython.rtyper.typesystem import LowLevelTypeSystem, getfunctionptr
+from rpython.rtyper.typesystem import getfunctionptr
 from rpython.rtyper import rclass
 from rpython.rtyper.rclass import RootClassRepr
 from rpython.tool.pairtype import pair
@@ -38,7 +38,6 @@
     def __init__(self, annotator):
         self.annotator = annotator
         self.lowlevel_ann_policy = LowLevelAnnotatorPolicy(self)
-        self.type_system = LowLevelTypeSystem()
         self.reprs = {}
         self._reprs_must_call_setup = []
         self._seen_reprs_must_call_setup = {}
diff --git a/rpython/rtyper/typesystem.py b/rpython/rtyper/typesystem.py
--- a/rpython/rtyper/typesystem.py
+++ b/rpython/rtyper/typesystem.py
@@ -2,20 +2,13 @@
 """typesystem.py -- Typesystem-specific operations for RTyper."""
 
 from rpython.rtyper.lltypesystem import lltype
-from rpython.rtyper.error import TyperError
 
 
-class LowLevelTypeSystem(object):
-    name = "lltypesystem"
-
 def _getconcretetype(v):
     return v.concretetype
 
-
-def getfunctionptr(graph, getconcretetype=None):
+def getfunctionptr(graph, getconcretetype=_getconcretetype):
     """Return callable given a Python function."""
-    if getconcretetype is None:
-        getconcretetype = _getconcretetype
     llinputs = [getconcretetype(v) for v in graph.getargs()]
     lloutput = getconcretetype(graph.getreturnvar())
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to