[pypy-commit] pypy use-file-star-for-file: undo these rtyper changes, don't seem necessary
bdkearns
noreply at buildbot.pypy.org
Fri Aug 29 03:53:21 CEST 2014
Author: Brian Kearns <bdkearns at gmail.com>
Branch: use-file-star-for-file
Changeset: r73136:65e70815a2db
Date: 2014-08-28 21:47 -0400
http://bitbucket.org/pypy/pypy/changeset/65e70815a2db/
Log: undo these rtyper changes, don't seem necessary
diff --git a/rpython/rtyper/annlowlevel.py b/rpython/rtyper/annlowlevel.py
--- a/rpython/rtyper/annlowlevel.py
+++ b/rpython/rtyper/annlowlevel.py
@@ -421,16 +421,12 @@
return lltype_to_annotation(lltype.Ptr(UNICODE))
def specialize_call(self, hop):
- from rpython.rtyper.lltypesystem.rstr import (string_repr,
- unicode_repr)
hop.exception_cannot_occur()
- if strtype is str:
- v_ll_str = hop.inputarg(string_repr, 0)
- else:
- v_ll_str = hop.inputarg(unicode_repr, 0)
+ assert hop.args_r[0].lowleveltype == hop.r_result.lowleveltype
+ v_ll_str, = hop.inputargs(*hop.args_r)
return hop.genop('same_as', [v_ll_str],
resulttype = hop.r_result.lowleveltype)
-
+
return hlstr, llstr
hlstr, llstr = make_string_entries(str)
diff --git a/rpython/rtyper/test/test_annlowlevel.py b/rpython/rtyper/test/test_annlowlevel.py
--- a/rpython/rtyper/test/test_annlowlevel.py
+++ b/rpython/rtyper/test/test_annlowlevel.py
@@ -34,14 +34,6 @@
res = self.interpret(f, [self.string_to_ll("abc")])
assert res == 3
- def test_llstr_const_char(self):
- def f(arg):
- s = llstr(hlstr(arg)[0])
- return len(s.chars)
-
- res = self.interpret(f, [self.string_to_ll("abc")])
- assert res == 1
-
def test_hlunicode(self):
s = mallocunicode(3)
s.chars[0] = u"a"
More information about the pypy-commit
mailing list