[pypy-svn] r25239 - pypy/dist/pypy/rpython

pedronis at codespeak.net pedronis at codespeak.net
Sun Apr 2 23:12:04 CEST 2006


Author: pedronis
Date: Sun Apr  2 23:12:04 2006
New Revision: 25239

Modified:
   pypy/dist/pypy/rpython/rgenop.py
Log:
(arre, pedronis)

debugging helpers to check whether a gv_type contains a pointer type



Modified: pypy/dist/pypy/rpython/rgenop.py
==============================================================================
--- pypy/dist/pypy/rpython/rgenop.py	(original)
+++ pypy/dist/pypy/rpython/rgenop.py	Sun Apr  2 23:12:04 2006
@@ -15,6 +15,10 @@
 # for debugging, sanity checks in non-RPython code
 reveal = from_opaque_object
 
+def isptrtype(gv_type):
+    c = from_opaque_object(gv_type)
+    return isinstance(c.value, lltype.Ptr)
+
 def initblock(opaqueptr):
     init_opaque_object(opaqueptr, flowmodel.Block([]))
 
@@ -281,6 +285,8 @@
 setannotation(closelink, None)
 setannotation(closereturnlink, None)
 
+setannotation(isptrtype, annmodel.SomeBool())
+
 # specialize
 setspecialize(initblock)
 setspecialize(geninputarg)
@@ -293,6 +299,8 @@
 setspecialize(closelink)
 setspecialize(closereturnlink)
 
+setspecialize(isptrtype)
+
 # XXX(for now) void constant constructors
 setannotation(constFieldName, s_ConstOrVar)
 setannotation(constTYPE, s_ConstOrVar)



More information about the Pypy-commit mailing list