[pypy-svn] r33805 - in pypy/dist/pypy: rpython translator/c/test

cfbolz at codespeak.net cfbolz at codespeak.net
Fri Oct 27 12:53:28 CEST 2006


Author: cfbolz
Date: Fri Oct 27 12:53:25 2006
New Revision: 33805

Modified:
   pypy/dist/pypy/rpython/rgc.py
   pypy/dist/pypy/rpython/rtyper.py
   pypy/dist/pypy/translator/c/test/test_newgc.py
Log:
remove a use of the now-useless driver_option


Modified: pypy/dist/pypy/rpython/rgc.py
==============================================================================
--- pypy/dist/pypy/rpython/rgc.py	(original)
+++ pypy/dist/pypy/rpython/rgc.py	Fri Oct 27 12:53:25 2006
@@ -28,10 +28,10 @@
     _type_ = GcPool
 
     def get_repr(self, rtyper, s_pool):
-        opt = rtyper.getdriveroptions()
+        config = rtyper.getconfig()
         # if the gc policy doesn't support allocation pools, lltype
         # pools as Void.
-        if opt and opt.gc not in ['framework', 'stacklessgc']:
+        if config.translation.gc not in ['framework', 'stacklessgc']:
             from pypy.annotation.model import s_None
             return rtyper.getrepr(s_None)
         else:
@@ -54,8 +54,8 @@
         r_pool_ptr = hop.rtyper.getrepr(s_pool_ptr)
 
         opname = 'gc_x_swap_pool'
-        opt = hop.rtyper.getdriveroptions()
-        if opt and opt.gc not in ['framework', 'stacklessgc']:
+        config = hop.rtyper.getconfig()
+        if config.translation.gc not in ['framework', 'stacklessgc']:
             # when the gc policy doesn't support pools, just return
             # the argument (which is lltyped as Void anyway)
             opname = 'same_as'
@@ -83,8 +83,8 @@
         from pypy.annotation import model as annmodel
         from pypy.rpython.memory.gc import X_CLONE, X_CLONE_PTR
 
-        opt = hop.rtyper.getdriveroptions()
-        if opt and opt.gc not in ['framework', 'stacklessgc']:
+        config = hop.rtyper.getconfig()
+        if config.translation.gc not in ['framework', 'stacklessgc']:
             # if the gc policy does not support allocation pools,
             # gc_clone always raises RuntimeError
             hop.exception_is_here()

Modified: pypy/dist/pypy/rpython/rtyper.py
==============================================================================
--- pypy/dist/pypy/rpython/rtyper.py	(original)
+++ pypy/dist/pypy/rpython/rtyper.py	Fri Oct 27 12:53:25 2006
@@ -91,8 +91,8 @@
 ##            log.info(s)
         self.crash_on_first_typeerror = True
 
-    def getdriveroptions(self):
-        return self.annotator.translator.driver_options
+    def getconfig(self):
+        return self.annotator.translator.config
 
     def getprimitiverepr(self, lltype):
         try:

Modified: pypy/dist/pypy/translator/c/test/test_newgc.py
==============================================================================
--- pypy/dist/pypy/translator/c/test/test_newgc.py	(original)
+++ pypy/dist/pypy/translator/c/test/test_newgc.py	Fri Oct 27 12:53:25 2006
@@ -376,11 +376,7 @@
     assert f()
 
 def test_gc_x_operations():
-    class FakeOptions:
-        pass
     t = TranslationContext()
-    t.driver_options = FakeOptions()
-    t.driver_options.gc = 'ref'
     from pypy.rpython.rgc import gc_clone, gc_swap_pool
     S = lltype.GcStruct("S", ('x', lltype.Signed))
     def f():



More information about the Pypy-commit mailing list