Author: Ronan Lamy <[email protected]>
Branch: kill-typesystem
Changeset: r65878:dec98a0d9628
Date: 2013-07-29 02:47 +0100
http://bitbucket.org/pypy/pypy/changeset/dec98a0d9628/

Log:    kill trivial getter

diff --git a/rpython/jit/metainterp/jitexc.py b/rpython/jit/metainterp/jitexc.py
--- a/rpython/jit/metainterp/jitexc.py
+++ b/rpython/jit/metainterp/jitexc.py
@@ -62,7 +62,7 @@
 
 
 def _get_standard_error(rtyper, Class):
-    exdata = rtyper.getexceptiondata()
+    exdata = rtyper.exceptiondata
     clsdef = rtyper.annotator.bookkeeper.getuniqueclassdef(Class)
     evalue = exdata.get_standard_ll_exc_instance(rtyper, clsdef)
     return evalue
diff --git a/rpython/memory/gctransform/transform.py 
b/rpython/memory/gctransform/transform.py
--- a/rpython/memory/gctransform/transform.py
+++ b/rpython/memory/gctransform/transform.py
@@ -105,7 +105,7 @@
             self.minimalgctransformer = None
 
     def get_lltype_of_exception_value(self):
-        exceptiondata = self.translator.rtyper.getexceptiondata()
+        exceptiondata = self.translator.rtyper.exceptiondata
         return exceptiondata.lltype_of_exception_value
 
     def need_minimal_transform(self, graph):
@@ -479,11 +479,11 @@
         flags = hop.spaceop.args[1].value
         flavor = flags['flavor']
         meth = getattr(self, 'gct_fv_%s_malloc' % flavor, None)
-        assert meth, "%s has no support for malloc with flavor %r" % (self, 
flavor) 
+        assert meth, "%s has no support for malloc with flavor %r" % (self, 
flavor)
         c_size = rmodel.inputconst(lltype.Signed, llmemory.sizeof(TYPE))
         v_raw = meth(hop, flags, TYPE, c_size)
         hop.cast_result(v_raw)
- 
+
     def gct_fv_raw_malloc(self, hop, flags, TYPE, c_size):
         v_raw = hop.genop("direct_call", [self.raw_malloc_fixedsize_ptr, 
c_size],
                           resulttype=llmemory.Address)
@@ -506,7 +506,7 @@
             flags.update(add_flags)
         flavor = flags['flavor']
         meth = getattr(self, 'gct_fv_%s_malloc_varsize' % flavor, None)
-        assert meth, "%s has no support for malloc_varsize with flavor %r" % 
(self, flavor) 
+        assert meth, "%s has no support for malloc_varsize with flavor %r" % 
(self, flavor)
         return self.varsize_malloc_helper(hop, flags, meth, [])
 
     def gct_malloc_nonmovable(self, *args, **kwds):
diff --git a/rpython/rtyper/llinterp.py b/rpython/rtyper/llinterp.py
--- a/rpython/rtyper/llinterp.py
+++ b/rpython/rtyper/llinterp.py
@@ -286,7 +286,7 @@
             rtyper = self.llinterpreter.typer
             bk = rtyper.annotator.bookkeeper
             classdef = bk.getuniqueclassdef(rstackovf._StackOverflow)
-            exdata = rtyper.getexceptiondata()
+            exdata = rtyper.exceptiondata
             evalue = exdata.get_standard_ll_exc_instance(rtyper, classdef)
             etype = exdata.fn_type_of_exc_inst(evalue)
             e = LLException(etype, evalue)
@@ -335,7 +335,7 @@
         elif catch_exception:
             link = block.exits[0]
             if e:
-                exdata = self.llinterpreter.typer.getexceptiondata()
+                exdata = self.llinterpreter.typer.exceptiondata
                 cls = e.args[0]
                 inst = e.args[1]
                 for link in block.exits[1:]:
@@ -440,7 +440,7 @@
         else:
             extraargs = ()
         typer = self.llinterpreter.typer
-        exdata = typer.getexceptiondata()
+        exdata = typer.exceptiondata
         if isinstance(exc, OSError):
             self.op_direct_call(exdata.fn_raise_OSError, exc.errno)
             assert False, "op_direct_call above should have raised"
diff --git a/rpython/rtyper/rtyper.py b/rpython/rtyper/rtyper.py
--- a/rpython/rtyper/rtyper.py
+++ b/rpython/rtyper/rtyper.py
@@ -100,9 +100,6 @@
         self._reprs_must_call_setup.append(repr)
         self._seen_reprs_must_call_setup[repr] = True
 
-    def getexceptiondata(self):
-        return self.exceptiondata    # built at the end of specialize()
-
     def lltype_to_classdef_mapping(self):
         result = {}
         for (classdef, _), repr in self.instance_reprs.iteritems():
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
@@ -329,7 +329,7 @@
         # 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
-        excdata = self.translator.rtyper.getexceptiondata()
+        excdata = self.translator.rtyper.exceptiondata
         exc_match = excdata.fn_exception_match
         for link in self.entrymap[self.graph_to_inline.exceptblock]:
             if link.prevblock.exits[0] is not link:
@@ -358,7 +358,7 @@
         #XXXXX don't look: insert blocks that do exception matching
         #for the cases where direct matching did not work
         exc_match = Constant(
-            self.translator.rtyper.getexceptiondata().fn_exception_match)
+            self.translator.rtyper.exceptiondata.fn_exception_match)
         exc_match.concretetype = typeOf(exc_match.value)
         blocks = []
         for i, link in enumerate(afterblock.exits[1:]):
diff --git a/rpython/translator/c/database.py b/rpython/translator/c/database.py
--- a/rpython/translator/c/database.py
+++ b/rpython/translator/c/database.py
@@ -357,7 +357,7 @@
                 yield node
 
     def get_lltype_of_exception_value(self):
-        exceptiondata = self.translator.rtyper.getexceptiondata()
+        exceptiondata = self.translator.rtyper.exceptiondata
         return exceptiondata.lltype_of_exception_value
 
     def getstructdeflist(self):
diff --git a/rpython/translator/c/extfunc.py b/rpython/translator/c/extfunc.py
--- a/rpython/translator/c/extfunc.py
+++ b/rpython/translator/c/extfunc.py
@@ -10,9 +10,7 @@
 # Note about *.im_func: The annotator and the rtyper expect direct
 # references to functions, so we cannot insert classmethods here.
 
-EXTERNALS = {
-    'LL_flush_icache': 'LL_flush_icache',
-    }
+EXTERNALS = {'LL_flush_icache': 'LL_flush_icache'}
 
 #______________________________________________________
 
@@ -93,7 +91,7 @@
 
 def predeclare_exception_data(db, rtyper):
     # Exception-related types and constants
-    exceptiondata = rtyper.getexceptiondata()
+    exceptiondata = rtyper.exceptiondata
     exctransformer = db.exctransformer
 
     yield ('RPYTHON_EXCEPTION_VTABLE', exceptiondata.lltype_of_exception_type)
diff --git a/rpython/translator/exceptiontransform.py 
b/rpython/translator/exceptiontransform.py
--- a/rpython/translator/exceptiontransform.py
+++ b/rpython/translator/exceptiontransform.py
@@ -49,7 +49,7 @@
     def __init__(self, translator):
         self.translator = translator
         self.raise_analyzer = canraise.RaiseAnalyzer(translator)
-        edata = translator.rtyper.getexceptiondata()
+        edata = translator.rtyper.exceptiondata
         self.lltype_of_exception_value = edata.lltype_of_exception_value
         self.lltype_of_exception_type = edata.lltype_of_exception_type
         self.mixlevelannotator = MixLevelHelperAnnotator(translator.rtyper)
@@ -169,7 +169,7 @@
                                   exception_policy="exc_helper", **kwds)
 
     def get_builtin_exception(self, Class):
-        edata = self.translator.rtyper.getexceptiondata()
+        edata = self.translator.rtyper.exceptiondata
         rclass = self.translator.rtyper.type_system.rclass
         bk = self.translator.annotator.bookkeeper
         error_def = bk.getuniqueclassdef(Class)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to