[pypy-svn] r67753 - in pypy/trunk/pypy: rpython/ootypesystem/module translator/cli

antocuni at codespeak.net antocuni at codespeak.net
Fri Sep 18 12:02:19 CEST 2009


Author: antocuni
Date: Fri Sep 18 12:02:13 2009
New Revision: 67753

Modified:
   pypy/trunk/pypy/rpython/ootypesystem/module/ll_os.py
   pypy/trunk/pypy/translator/cli/database.py
Log:
use the correct tuple types in the cli backend; test_builtin passes again


Modified: pypy/trunk/pypy/rpython/ootypesystem/module/ll_os.py
==============================================================================
--- pypy/trunk/pypy/rpython/ootypesystem/module/ll_os.py	(original)
+++ pypy/trunk/pypy/rpython/ootypesystem/module/ll_os.py	Fri Sep 18 12:02:13 2009
@@ -1,13 +1,7 @@
 # mostly-deprecated module
 
 from pypy.rpython.ootypesystem import ootype
-
-def _make_tuple(FIELDS):
-    n = len(FIELDS)
-    fieldnames = ['item%d' % i for i in range(n)]
-    fields = dict(zip(fieldnames, FIELDS))
-    return ootype.Record(fields)
-
+from pypy.rpython.ootypesystem.rtupletype import TUPLE_TYPE
 from pypy.rpython.module.ll_os_stat import PORTABLE_STAT_FIELDS
 
-STAT_RESULT = _make_tuple([_TYPE for _name, _TYPE in PORTABLE_STAT_FIELDS])
+STAT_RESULT = TUPLE_TYPE([_TYPE for _name, _TYPE in PORTABLE_STAT_FIELDS])

Modified: pypy/trunk/pypy/translator/cli/database.py
==============================================================================
--- pypy/trunk/pypy/translator/cli/database.py	(original)
+++ pypy/trunk/pypy/translator/cli/database.py	Fri Sep 18 12:02:13 2009
@@ -9,7 +9,8 @@
 from pypy.translator.cli.support import string_literal, Counter
 from pypy.translator.cli.cts import types
 from pypy.rpython.ootypesystem import ootype
-from pypy.rpython.ootypesystem.module import ll_os
+from pypy.rpython.ootypesystem.module import ll_os, ll_math
+from pypy.rpython.ootypesystem.rtupletype import TUPLE_TYPE
 from pypy.translator.cli import dotnet
 from pypy.rlib.objectmodel import CDefinedIntSymbolic
 from pypy.translator.oosupport.database import Database as OODatabase
@@ -20,18 +21,13 @@
     from sets import Set as set
 
 BUILTIN_RECORDS = {
-    ootype.Record({"item0": ootype.Signed, "item1": ootype.Signed}):
-    '[pypylib]pypy.runtime.Record_Signed_Signed',
-    
-    ootype.Record({"item0": ootype.Float, "item1": ootype.Signed}):
-    '[pypylib]pypy.runtime.Record_Float_Signed',
-    
-    ootype.Record({"item0": ootype.Float, "item1": ootype.Float}):
-    '[pypylib]pypy.runtime.Record_Float_Float',
-
-    ootype.Record({"item0": ootype.String, "item1": ootype.String}):
-    '[pypylib]pypy.runtime.Record_String_String',
+    TUPLE_TYPE([ootype.Signed, ootype.Signed]):
+        '[pypylib]pypy.runtime.Record_Signed_Signed',
+    TUPLE_TYPE([ootype.String, ootype.String]): 
+        '[pypylib]pypy.runtime.Record_String_String',
 
+    ll_math.FREXP_RESULT: '[pypylib]pypy.runtime.Record_Float_Signed',    
+    ll_math.MODF_RESULT: '[pypylib]pypy.runtime.Record_Float_Float',
     ll_os.STAT_RESULT: '[pypylib]pypy.runtime.Record_Stat_Result',
     }
 



More information about the Pypy-commit mailing list