[pypy-commit] pypy type_system-cleanup: Kill LowLevelTypeSystem.null_callable

rlamy noreply at buildbot.pypy.org
Fri Oct 9 05:31:12 CEST 2015


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: type_system-cleanup
Changeset: r80066:f6ba7904d62c
Date: 2015-10-08 20:46 +0100
http://bitbucket.org/pypy/pypy/changeset/f6ba7904d62c/

Log:	Kill LowLevelTypeSystem.null_callable

diff --git a/rpython/rtyper/rpbc.py b/rpython/rtyper/rpbc.py
--- a/rpython/rtyper/rpbc.py
+++ b/rpython/rtyper/rpbc.py
@@ -266,7 +266,7 @@
             else:
                 # missing entry -- need a 'null' of the type that matches
                 # this row
-                llfn = self.rtyper.type_system.null_callable(row.fntype)
+                llfn = nullptr(row.fntype.TO)
             llfns[row.attrname] = llfn
         if len(self.uniquerows) == 1:
             if found_anything:
@@ -291,7 +291,7 @@
         elif isinstance(value, staticmethod):
             value = value.__get__(42)  # hackish, get the function wrapped by staticmethod
         if value is None:
-            null = self.rtyper.type_system.null_callable(self.lowleveltype)
+            null = nullptr(self.lowleveltype.TO)
             return null
         funcdesc = self.rtyper.annotator.bookkeeper.getdesc(value)
         return self.convert_desc(funcdesc)
@@ -914,7 +914,7 @@
                 return None
             else:
                 T = self.lowleveltype
-                return self.rtyper.type_system.null_callable(T)
+                return nullptr(T.TO)
         bk = self.rtyper.annotator.bookkeeper
         classdesc = bk.getdesc(cls)
         return self.convert_desc(classdesc)
diff --git a/rpython/rtyper/typesystem.py b/rpython/rtyper/typesystem.py
--- a/rpython/rtyper/typesystem.py
+++ b/rpython/rtyper/typesystem.py
@@ -13,9 +13,6 @@
         vlist = hop.inputargs(repr)
         return hop.genop('ptr_nonzero', vlist, resulttype=lltype.Bool)
 
-    def null_callable(self, T):
-        return lltype.nullptr(T.TO)
-
     def getexternalcallable(self, ll_args, ll_result, name, **kwds):
         FT = lltype.FuncType(ll_args, ll_result)
         return lltype.functionptr(FT, name, **kwds)


More information about the pypy-commit mailing list