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

pedronis at codespeak.net pedronis at codespeak.net
Sun Apr 2 19:01:07 CEST 2006


Author: pedronis
Date: Sun Apr  2 19:01:06 2006
New Revision: 25229

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

adding some useful type and constant defs to rgenop directly.



Modified: pypy/dist/pypy/rpython/rgenop.py
==============================================================================
--- pypy/dist/pypy/rpython/rgenop.py	(original)
+++ pypy/dist/pypy/rpython/rgenop.py	Sun Apr  2 19:01:06 2006
@@ -230,7 +230,24 @@
 fields = tuple(zip(fieldnames, lltypes))    
 LINKPAIR = lltype.GcStruct('tuple2', *fields)
 
+# support constants and types
+
 nullvar = lltype.nullptr(CONSTORVAR.TO)
+gv_Void = constTYPE(lltype.Void)
+
+# VARLIST
+def ll_fixed_items(l):
+    return l
+
+def ll_fixed_length(l):
+    return len(l)
+
+VARLIST = lltype.Ptr(lltype.GcArray(CONSTORVAR,
+                                    adtmeths = {
+                                        "ll_items": ll_fixed_items,
+                                        "ll_length": ll_fixed_length
+                                    }))
+
 
 # helpers
 def setannotation(func, TYPE):



More information about the Pypy-commit mailing list