[pypy-svn] r27872 - pypy/dist/pypy/translator/cli

fijal at codespeak.net fijal at codespeak.net
Mon May 29 19:39:42 CEST 2006


Author: fijal
Date: Mon May 29 19:39:41 2006
New Revision: 27872

Modified:
   pypy/dist/pypy/translator/cli/database.py
   pypy/dist/pypy/translator/cli/gencli.py
   pypy/dist/pypy/translator/cli/ilgenerator.py
   pypy/dist/pypy/translator/cli/oopspec.py
Log:
Necessary compatibility issues for gencli reuse by genjs.


Modified: pypy/dist/pypy/translator/cli/database.py
==============================================================================
--- pypy/dist/pypy/translator/cli/database.py	(original)
+++ pypy/dist/pypy/translator/cli/database.py	Mon May 29 19:39:41 2006
@@ -69,8 +69,6 @@
         return '%s.%s::%s' % (CONST_NAMESPACE, CONST_CLASS, name)
 
     def gen_constants(self, ilasm):
-        if not ilasm.show_const():
-            return
         ilasm.begin_namespace(CONST_NAMESPACE)
         ilasm.begin_class(CONST_CLASS)
 
@@ -104,7 +102,7 @@
 
         # the constructor calls the steps in reverse order
         ilasm.begin_function('.cctor', [], 'void', False, 'static',
-                             'specialname', 'rtspecialname', 'default')
+            'specialname', 'rtspecialname', 'default')
 
         last_step = step-1
         for step in xrange(last_step, -1, -1):

Modified: pypy/dist/pypy/translator/cli/gencli.py
==============================================================================
--- pypy/dist/pypy/translator/cli/gencli.py	(original)
+++ pypy/dist/pypy/translator/cli/gencli.py	Mon May 29 19:39:41 2006
@@ -26,12 +26,12 @@
 class GenCli(object):
     def __init__(self, tmpdir, translator, entrypoint=None, type_system_class=CTS,
                  opcode_dict=opcodes, name_suffix='.il', function_class=Function,
-                 pending_graphs=()):
+                 database_class = LowLevelDatabase, pending_graphs=()):
         self.tmpdir = tmpdir
         self.translator = translator
         self.entrypoint = entrypoint
-        self.db = LowLevelDatabase( type_system_class = type_system_class , opcode_dict = opcode_dict,
-            function_class = function_class )
+        self.db = database_class(type_system_class = type_system_class, opcode_dict = opcode_dict,
+            function_class = function_class)
 
         for graph in pending_graphs:
             self.db.pending_function(graph)

Modified: pypy/dist/pypy/translator/cli/ilgenerator.py
==============================================================================
--- pypy/dist/pypy/translator/cli/ilgenerator.py	(original)
+++ pypy/dist/pypy/translator/cli/ilgenerator.py	Mon May 29 19:39:41 2006
@@ -43,9 +43,6 @@
         self.code.writeline('.assembly extern pypylib {}')
         self.code.writeline('.assembly %s {}' % name)
 
-    def show_const(self):
-        return True
-
     def close(self):
         self.out.close()
 

Modified: pypy/dist/pypy/translator/cli/oopspec.py
==============================================================================
--- pypy/dist/pypy/translator/cli/oopspec.py	(original)
+++ pypy/dist/pypy/translator/cli/oopspec.py	Mon May 29 19:39:41 2006
@@ -10,6 +10,9 @@
     # builtin methods take the same arguments of the corresponding
     # ll_* function.
     full_name, _ = oopspec.split('(', 1)
+
+    if len(full_name.split('.')) != 2:
+        return None
     try:
         type_name, method_name = full_name.split('.')
     except ValueError:



More information about the Pypy-commit mailing list