[pypy-commit] pypy default: inline single-use function
rlamy
noreply at buildbot.pypy.org
Sat May 31 22:58:48 CEST 2014
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch:
Changeset: r71791:d3305f62abe4
Date: 2014-05-31 21:58 +0100
http://bitbucket.org/pypy/pypy/changeset/d3305f62abe4/
Log: inline single-use function
diff --git a/rpython/rtyper/rmodel.py b/rpython/rtyper/rmodel.py
--- a/rpython/rtyper/rmodel.py
+++ b/rpython/rtyper/rmodel.py
@@ -345,17 +345,6 @@
# ____________________________________________________________
-def inputdesc(reqtype, desc):
- """Return a Constant for the given desc, of the requested type,
- which can only be a Repr.
- """
- assert isinstance(reqtype, Repr)
- value = reqtype.convert_desc(desc)
- lltype = reqtype.lowleveltype
- c = Constant(value)
- c.concretetype = lltype
- return c
-
def inputconst(reqtype, value):
"""Return a Constant with the given value, of the requested type,
which can be a Repr instance or a low-level type.
diff --git a/rpython/rtyper/rpbc.py b/rpython/rtyper/rpbc.py
--- a/rpython/rtyper/rpbc.py
+++ b/rpython/rtyper/rpbc.py
@@ -7,7 +7,7 @@
from rpython.rtyper.error import TyperError
from rpython.rtyper.lltypesystem.lltype import typeOf, Void
from rpython.rtyper.rmodel import (Repr, inputconst, CanBeNull, mangle,
- inputdesc, warning, impossible_repr)
+ warning, impossible_repr)
from rpython.tool.pairtype import pair, pairtype
@@ -495,7 +495,9 @@
frozendesc1 = r_pbc1.frozendesc
access = frozendesc1.queryattrfamily()
if access is r_pbc2.access_set:
- return inputdesc(r_pbc2, frozendesc1)
+ value = r_pbc2.convert_desc(frozendesc1)
+ lltype = r_pbc2.lowleveltype
+ return Constant(value, lltype)
return NotImplemented
class __extend__(pairtype(AbstractMultipleUnrelatedFrozenPBCRepr,
More information about the pypy-commit
mailing list