Commits

Manuel Jacob committed 39d51dc

Add stub task_transform and fix test_driver.py.

Comments (0)

Files changed (2)

rpython/translator/driver.py

 from rpython.tool.udir import udir
 from rpython.rlib.debug import debug_start, debug_print, debug_stop
 from rpython.rlib.entrypoint import secondary_entrypoints
+from rpython.rtyper.typesystem import getfunctionptr
 
 import py
 from rpython.tool.ansi_print import ansi_log
         if not self.config.translation.backendopt.none:
             expose_task(self.task_backendopt)
         expose_task(self.task_stackcheckinsertion)
+        expose_task(self.task_transform)
         for task in backends[self.config.translation.backend](self).get_tasks():
             expose_task(task)
 
         count = insert_ll_stackcheck(self.translator)
         self.log.info("inserted %d stack checks." % (count,))
 
+    @taskdef("exception and gc transformations")
+    def task_transform(self):
+        pass
+
     @taskdef("LLInterpreting")
     def task_llinterpret(self):
         from rpython.rtyper.llinterp import LLInterpreter

rpython/translator/test/test_driver.py

 def test_c_no_jit():
     td = TranslationDriver()
     td.setup(None, None)
-    names = ['annotate', 'rtype', 'backendopt', 'stackcheckinsertion_lltype',
-             'database', 'source', 'compile']
+    names = ['annotate', 'rtype', 'backendopt', 'stackcheckinsertion',
+             'transform', 'database', 'source', 'compile']
     assert [task.task_name for task in td.tasks] == names
 
 
     td = TranslationDriver({'jit': True})
     td.setup(None, None)
     names = ['annotate', 'rtype', 'pyjitpl', 'backendopt',
-             'stackcheckinsertion_lltype', 'database', 'source', 'compile']
+             'stackcheckinsertion', 'transform', 'database', 'source',
+             'compile']
     assert [task.task_name for task in td.tasks] == names
 
 
 def test_no_backendopt():
     td = TranslationDriver({'backendopt.none': True})
     td.setup(None, None)
-    names = ['annotate', 'rtype', 'stackcheckinsertion_lltype', 'database',
-             'source', 'compile']
+    names = ['annotate', 'rtype', 'stackcheckinsertion', 'transform',
+             'database', 'source', 'compile']
     assert [task.task_name for task in td.tasks] == names
 
 
 def test_simple_annotate():
-
     def f(x,y):
         return x+y
 
     t = Translation(f, [int, int])
+    s = t.annotate()
+    assert s.knowntype == int
+    assert 'annotate' in t.driver.done
     assert t.context is t.driver.translator
     assert t.config is t.driver.config is t.context.config
-    
-    s = t.annotate()
-    assert s.knowntype == int
-
-    t = Translation(f, [int, int])
-    s = t.annotate()
-    assert s.knowntype == int
-
 
 def test_simple_rtype():
-
     def f(x,y):
         return x+y
 
     t = Translation(f, [int, int])
-    t.annotate()
     t.rtype()
-
+    assert 'annotate' in t.driver.done
     assert 'rtype' in t.driver.done
 
 def test_simple_backendopt():
 
 def test_simple_compile_c():
     import ctypes
-    
+
     def f(x,y):
         return x+y
 
     dll = ctypes.CDLL(str(t.driver.c_entryp))
     f = dll.pypy_g_f
     assert f(2, 3) == 5
-
-def test_simple_rtype_with_type_system():
-
-    def f(x,y):
-        return x+y
-
-    t = Translation(f, [int, int])
-    t.rtype()
-
-    t = Translation(f, [int, int], type_system='ootype')
-    t.rtype()
-    assert 'rtype' in t.driver.done
-
-    #t = Translation(f, [int, int], backend='cli', type_system='ootype')
-    #t.rtype()
-    #assert 'rtype' in t.driver.done