[pypy-svn] r15446 - in pypy/dist/pypy/translator/llvm2: . test

rxe at codespeak.net rxe at codespeak.net
Sat Jul 30 22:38:25 CEST 2005


Author: rxe
Date: Sat Jul 30 22:38:15 2005
New Revision: 15446

Modified:
   pypy/dist/pypy/translator/llvm2/opwriter.py
   pypy/dist/pypy/translator/llvm2/test/test_genllvm1.py
Log:
setfield should skip voids.  enable skipping pbc test.


Modified: pypy/dist/pypy/translator/llvm2/opwriter.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/opwriter.py	(original)
+++ pypy/dist/pypy/translator/llvm2/opwriter.py	Sat Jul 30 22:38:15 2005
@@ -301,12 +301,14 @@
         struct, structtype = self.db.repr_argwithtype(op.args[0])
         fieldnames = list(op.args[0].concretetype.TO._names)
         index = fieldnames.index(op.args[1].value)
-        self.codewriter.getelementptr(tmpvar, structtype, struct,
-                                      ("uint", index))
         valuevar, valuetype = self.db.repr_argwithtype(op.args[2])
-        assert valuetype != "void"
-        self.codewriter.store(valuetype, valuevar, tmpvar) 
-
+        if valuetype != "void": 
+            self.codewriter.getelementptr(tmpvar, structtype, struct,
+                                          ("uint", index))
+            self.codewriter.store(valuetype, valuevar, tmpvar) 
+        else:
+            self.codewriter.comment("***Skipping operation setfield()***")
+            
     def getarrayitem(self, op):        
         array, arraytype = self.db.repr_argwithtype(op.args[0])
         index = self.db.repr_arg(op.args[1])
@@ -316,6 +318,8 @@
                                       ("uint", 1), (indextype, index))
         targetvar = self.db.repr_arg(op.result)
         targettype = self.db.repr_arg_type(op.result)
+        #XXX These should skip too if the case comes up
+        assert targettype != "void"
         self.codewriter.load(targetvar, targettype, tmpvar)
 
     def getarraysubstruct(self, op):        
@@ -337,6 +341,8 @@
 
         valuevar = self.db.repr_arg(op.args[2]) 
         valuetype = self.db.repr_arg_type(op.args[2])
+        #XXX These should skip too if the case comes up
+        assert valuetype != "void"
         self.codewriter.store(valuetype, valuevar, tmpvar) 
 
     def getarraysize(self, op):

Modified: pypy/dist/pypy/translator/llvm2/test/test_genllvm1.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/test/test_genllvm1.py	(original)
+++ pypy/dist/pypy/translator/llvm2/test/test_genllvm1.py	Sat Jul 30 22:38:15 2005
@@ -89,7 +89,6 @@
         assert f(3) == 8
 
     def test_pbc_function2(self):
-        py.test.skip("pbc circular not working yet")
         f = compile_function(llvmsnippet.pbc_function2, [int])
         assert f(0) == 13
         assert f(1) == 15



More information about the Pypy-commit mailing list