[pypy-svn] r68838 - in pypy/branch/logging/pypy: rpython/memory/test translator/c
arigo at codespeak.net
arigo at codespeak.net
Thu Oct 29 11:22:19 CET 2009
Author: arigo
Date: Thu Oct 29 11:22:19 2009
New Revision: 68838
Modified:
pypy/branch/logging/pypy/rpython/memory/test/test_transformed_gc.py
pypy/branch/logging/pypy/translator/c/genc.py
Log:
Urgh. test_transformed_gc used to make a CStandaloneBuilder,
but the entry point was not taking a list of strings at all.
Fixed by adding a minimal CTestBuilder.
Modified: pypy/branch/logging/pypy/rpython/memory/test/test_transformed_gc.py
==============================================================================
--- pypy/branch/logging/pypy/rpython/memory/test/test_transformed_gc.py (original)
+++ pypy/branch/logging/pypy/rpython/memory/test/test_transformed_gc.py Thu Oct 29 11:22:19 2009
@@ -98,7 +98,7 @@
cleanup()
return res
- from pypy.translator.c.genc import CStandaloneBuilder
+ from pypy.translator.c.genc import CTestBuilder
s_args = annmodel.SomePtr(lltype.Ptr(ARGS))
t = rtype(entrypoint, [s_args], gcname=cls.gcname,
@@ -109,11 +109,10 @@
if fixup:
fixup(t)
- cbuild = CStandaloneBuilder(t, entrypoint, config=t.config,
- gcpolicy=cls.gcpolicy)
+ cbuild = CTestBuilder(t, entrypoint, config=t.config,
+ gcpolicy=cls.gcpolicy)
db = cbuild.generate_graphs_for_llinterp()
- entrypointptr = cbuild.getentrypointptr()
- entrygraph = entrypointptr._obj.graph
+ entrygraph = t._graphof(cbuild.entrypoint)
if conftest.option.view:
t.viewcg()
Modified: pypy/branch/logging/pypy/translator/c/genc.py
==============================================================================
--- pypy/branch/logging/pypy/translator/c/genc.py (original)
+++ pypy/branch/logging/pypy/translator/c/genc.py Thu Oct 29 11:22:19 2009
@@ -301,6 +301,14 @@
pass
+class CTestBuilder(CBuilder):
+ # only for tests
+ standalone = True
+ def getentrypointptr(self, db):
+ bk = self.translator.annotator.bookkeeper
+ return getfunctionptr(bk.getdesc(self.entrypoint).getuniquegraph())
+
+
class CExtModuleBuilder(CBuilder):
standalone = False
_module = None
More information about the Pypy-commit
mailing list