[pypy-svn] r27767 - pypy/dist/pypy/translator/cl

sanxiyn at codespeak.net sanxiyn at codespeak.net
Sat May 27 17:28:28 CEST 2006


Author: sanxiyn
Date: Sat May 27 17:28:24 2006
New Revision: 27767

Modified:
   pypy/dist/pypy/translator/cl/gencl.py
Log:
Reorder code


Modified: pypy/dist/pypy/translator/cl/gencl.py
==============================================================================
--- pypy/dist/pypy/translator/cl/gencl.py	(original)
+++ pypy/dist/pypy/translator/cl/gencl.py	Sat May 27 17:28:24 2006
@@ -253,7 +253,14 @@
             for line in emit_op:
                 yield line
         exits = block.exits
-        if len(exits) == 1:
+        if len(exits) == 0:
+            if len(block.inputargs) == 2:
+                exc_value = clrepr(block.inputargs[1])
+                yield "(error %s)" % (exc_value,)
+            else:
+                retval = clrepr(block.inputargs[0])
+                yield "(return %s)" % (retval,)
+        elif len(exits) == 1:
             for line in self.emit_link(exits[0]):
                 yield line
         elif len(exits) > 1:
@@ -303,12 +310,6 @@
                 for line in self.emit_link(exits[-1]):
                     yield line
                 yield ")" * len(exits)
-        elif len(block.inputargs) == 2:
-            exc_value = clrepr(block.inputargs[1], True)
-            yield "(error %s)" % (exc_value,)
-        else:
-            retval = clrepr(block.inputargs[0])
-            yield "(return %s)" % clrepr(retval, True)
         if handle_exc:
             yield ")"
 



More information about the Pypy-commit mailing list