[pypy-commit] pypy kill-typesystem: rm attr type_system.rclass

rlamy noreply at buildbot.pypy.org
Thu Aug 1 19:31:29 CEST 2013


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: kill-typesystem
Changeset: r65881:981476ac5e16
Date: 2013-07-31 16:46 +0100
http://bitbucket.org/pypy/pypy/changeset/981476ac5e16/

Log:	rm attr type_system.rclass

diff --git a/rpython/rtyper/exceptiondata.py b/rpython/rtyper/exceptiondata.py
--- a/rpython/rtyper/exceptiondata.py
+++ b/rpython/rtyper/exceptiondata.py
@@ -51,8 +51,8 @@
         return helper_fn
 
     def get_standard_ll_exc_instance(self, rtyper, clsdef):
-        rclass = rtyper.type_system.rclass
-        r_inst = rclass.getinstancerepr(rtyper, clsdef)
+        from rpython.rtyper.lltypesystem.rclass import getinstancerepr
+        r_inst = getinstancerepr(rtyper, clsdef)
         example = r_inst.get_reusable_prebuilt_instance()
         example = ll_cast_to_object(example)
         return example
diff --git a/rpython/rtyper/lltypesystem/rstr.py b/rpython/rtyper/lltypesystem/rstr.py
--- a/rpython/rtyper/lltypesystem/rstr.py
+++ b/rpython/rtyper/lltypesystem/rstr.py
@@ -317,7 +317,7 @@
 
     def ll_str2bytearray(str):
         from rpython.rtyper.lltypesystem.rbytearray import BYTEARRAY
-        
+
         lgt = len(str.chars)
         b = malloc(BYTEARRAY, lgt)
         for i in range(lgt):
@@ -974,7 +974,7 @@
 
         argsiter = iter(sourcevarsrepr)
 
-        InstanceRepr = hop.rtyper.type_system.rclass.InstanceRepr
+        from rpython.rtyper.lltypesystem.rclass import InstanceRepr
         for i, thing in enumerate(things):
             if isinstance(thing, tuple):
                 code = thing[0]
@@ -1007,7 +1007,6 @@
                 else:
                     raise TyperError("%%%s is not RPython" % (code,))
             else:
-                from rpython.rtyper.lltypesystem.rstr import string_repr, unicode_repr
                 if is_unicode:
                     vchunk = inputconst(unicode_repr, thing)
                 else:
diff --git a/rpython/rtyper/rclass.py b/rpython/rtyper/rclass.py
--- a/rpython/rtyper/rclass.py
+++ b/rpython/rtyper/rclass.py
@@ -54,7 +54,8 @@
     try:
         result = rtyper.class_reprs[classdef]
     except KeyError:
-        result = rtyper.type_system.rclass.ClassRepr(rtyper, classdef)
+        from rpython.rtyper.lltypesystem.rclass import ClassRepr
+        result = ClassRepr(rtyper, classdef)
         rtyper.class_reprs[classdef] = result
         rtyper.add_pendingsetup(result)
     return result
@@ -103,7 +104,8 @@
         from rpython.rtyper.lltypesystem import rtagged
         return rtagged.TaggedInstanceRepr(rtyper, classdef, unboxed[0])
     else:
-        return rtyper.type_system.rclass.InstanceRepr(rtyper, classdef, gcflavor)
+        from rpython.rtyper.lltypesystem.rclass import InstanceRepr
+        return InstanceRepr(rtyper, classdef, gcflavor)
 
 
 class MissingRTypeAttribute(TyperError):
diff --git a/rpython/translator/backendopt/inline.py b/rpython/translator/backendopt/inline.py
--- a/rpython/translator/backendopt/inline.py
+++ b/rpython/translator/backendopt/inline.py
@@ -328,7 +328,7 @@
     def rewire_exceptblock_with_guard(self, afterblock, copiedexceptblock):
         # this rewiring does not always succeed. in the cases where it doesn't
         # there will be generic code inserted
-        rclass = self.translator.rtyper.type_system.rclass
+        from rpython.rtyper.lltypesystem import rclass
         excdata = self.translator.rtyper.exceptiondata
         exc_match = excdata.fn_exception_match
         for link in self.entrymap[self.graph_to_inline.exceptblock]:


More information about the pypy-commit mailing list