[pypy-svn] r24813 - in pypy/branch/explicit-exceptions/translator/c: . test

mwh at codespeak.net mwh at codespeak.net
Wed Mar 22 19:46:57 CET 2006


Author: mwh
Date: Wed Mar 22 19:46:55 2006
New Revision: 24813

Modified:
   pypy/branch/explicit-exceptions/translator/c/database.py
   pypy/branch/explicit-exceptions/translator/c/funcgen.py
   pypy/branch/explicit-exceptions/translator/c/test/test_exceptiontransform.py
Log:
over-confidence: apply the exception transform to all graphs.



Modified: pypy/branch/explicit-exceptions/translator/c/database.py
==============================================================================
--- pypy/branch/explicit-exceptions/translator/c/database.py	(original)
+++ pypy/branch/explicit-exceptions/translator/c/database.py	Wed Mar 22 19:46:55 2006
@@ -13,6 +13,7 @@
 from pypy.translator.c.pyobj import PyObjMaker
 from pypy.translator.c.support import log
 from pypy.translator.c.extfunc import do_the_getting
+from pypy.translator.c.exceptiontransform import ExceptionTransformer
 
 # ____________________________________________________________
 
@@ -38,6 +39,7 @@
         if gcpolicy is None:
             from pypy.translator.c import gc
             gcpolicy = gc.RefcountingGcPolicy
+        self.exctransformer = ExceptionTransformer(translator)
         self.gcpolicy = gcpolicy(self, thread_enabled)
         self.gctransformer = gcpolicy.transformerclass(translator)
         self.completed = False

Modified: pypy/branch/explicit-exceptions/translator/c/funcgen.py
==============================================================================
--- pypy/branch/explicit-exceptions/translator/c/funcgen.py	(original)
+++ pypy/branch/explicit-exceptions/translator/c/funcgen.py	Wed Mar 22 19:46:55 2006
@@ -36,6 +36,8 @@
         self.gcpolicy = db.gcpolicy
         self.cpython_exc = cpython_exc
         self.functionname = functionname
+        # apply the exception transformation
+        self.db.exctransformer.create_exception_handling(self.graph)
         # apply the gc transformation
         self.db.gctransformer.transform_graph(self.graph)
         #self.graph.show()

Modified: pypy/branch/explicit-exceptions/translator/c/test/test_exceptiontransform.py
==============================================================================
--- pypy/branch/explicit-exceptions/translator/c/test/test_exceptiontransform.py	(original)
+++ pypy/branch/explicit-exceptions/translator/c/test/test_exceptiontransform.py	Wed Mar 22 19:46:55 2006
@@ -36,8 +36,8 @@
     t = TranslationContext()
     t.buildannotator().build_types(fn, inputtypes)
     t.buildrtyper().specialize()
-    etrafo = exceptiontransform.ExceptionTransformer(t)
-    etrafo.transform_completely()
+##     etrafo = exceptiontransform.ExceptionTransformer(t)
+##     etrafo.transform_completely()
     builder = genc.CExtModuleBuilder(t, fn, gcpolicy=gc.BoehmGcPolicy)
     builder.generate_source()
     skip_missing_compiler(builder.compile)



More information about the Pypy-commit mailing list