[pypy-svn] r35360 - pypy/dist/pypy/rpython
arigo at codespeak.net
arigo at codespeak.net
Wed Dec 6 03:12:23 CET 2006
Author: arigo
Date: Wed Dec 6 03:12:04 2006
New Revision: 35360
Modified:
pypy/dist/pypy/rpython/raddress.py
pypy/dist/pypy/rpython/rptr.py
Log:
(pedronis, arigo)
Another ll_str, to support str(address).
Modified: pypy/dist/pypy/rpython/raddress.py
==============================================================================
--- pypy/dist/pypy/rpython/raddress.py (original)
+++ pypy/dist/pypy/rpython/raddress.py Wed Dec 6 03:12:04 2006
@@ -7,6 +7,7 @@
from pypy.rpython.rmodel import Repr, IntegerRepr
from pypy.rpython.rptr import PtrRepr
from pypy.rpython.lltypesystem import lltype
+from pypy.rlib.rarithmetic import r_uint
class __extend__(annmodel.SomeAddress):
def rtyper_makerepr(self, rtyper):
@@ -36,6 +37,11 @@
assert not isinstance(value, _address)
return value
+ def ll_str(self, a):
+ from pypy.rpython.lltypesystem.rstr import ll_str
+ id = cast_adr_to_int(a)
+ return ll_str.ll_int2hex(r_uint(id), True)
+
def rtype_getattr(self, hop):
v_access = hop.inputarg(address_repr, 0)
return v_access
Modified: pypy/dist/pypy/rpython/rptr.py
==============================================================================
--- pypy/dist/pypy/rpython/rptr.py (original)
+++ pypy/dist/pypy/rpython/rptr.py Wed Dec 6 03:12:04 2006
@@ -27,7 +27,7 @@
self.lowleveltype = ptrtype
def ll_str(self, p):
- from pypy.rpython.lltypesystem.rstr import LLHelpers, ll_str
+ from pypy.rpython.lltypesystem.rstr import ll_str
id = lltype.cast_ptr_to_int(p)
return ll_str.ll_int2hex(r_uint(id), True)
More information about the pypy-svn
mailing list