[pypy-svn] r12201 - pypy/dist/pypy/translator/genc

arigo at codespeak.net arigo at codespeak.net
Wed May 11 21:50:11 CEST 2005


Author: arigo
Date: Wed May 11 21:50:11 2005
New Revision: 12201

Modified:
   pypy/dist/pypy/translator/genc/ctyper.py
Log:
Wrong logic that hided simple_call to SomePBCs.



Modified: pypy/dist/pypy/translator/genc/ctyper.py
==============================================================================
--- pypy/dist/pypy/translator/genc/ctyper.py	(original)
+++ pypy/dist/pypy/translator/genc/ctyper.py	Wed May 11 21:50:11 2005
@@ -128,12 +128,8 @@
         return besttype
 
     def specialized_op(self, op, bindings):
-        if op.opname in ('newtuple', 'newlist'):
-            # operations that are controlled by their return type
-            s_binding = self.annotator.binding(op.result, True)
-        elif op.opname == 'simple_call' and isinstance(op.args[0], Constant):
+        if op.opname == 'simple_call' and isinstance(op.args[0], Constant):
             # XXX move me elsewhere
-            s_binding = None
             func = op.args[0].value
             if func is lltypes.malloc:
                 assert len(op.args) == 2   # for now
@@ -144,6 +140,9 @@
                                                  op.result),
                                   [ct], self.annotation2concretetype(s_result))
                     ]
+        if op.opname in ('newtuple', 'newlist'):
+            # operations that are controlled by their return type
+            s_binding = self.annotator.binding(op.result, True)
         elif bindings:
             # operations are by default controlled by their 1st arg
             s_binding = bindings[0]



More information about the Pypy-commit mailing list