[pypy-svn] r28901 - pypy/dist/pypy/rpython/lltypesystem

pedronis at codespeak.net pedronis at codespeak.net
Fri Jun 16 23:35:00 CEST 2006


Author: pedronis
Date: Fri Jun 16 23:34:58 2006
New Revision: 28901

Modified:
   pypy/dist/pypy/rpython/lltypesystem/lloperation.py
Log:
the relationship of canfold and canraise is a bit unclear, exceptions can be used to change flow of controls.
remove canfold from the decls arith ops that can raise
 


Modified: pypy/dist/pypy/rpython/lltypesystem/lloperation.py
==============================================================================
--- pypy/dist/pypy/rpython/lltypesystem/lloperation.py	(original)
+++ pypy/dist/pypy/rpython/lltypesystem/lloperation.py	Fri Jun 16 23:34:58 2006
@@ -26,6 +26,8 @@
         self.canraise = canraise
         assert isinstance(canraise, tuple)
 
+        assert not canraise or not canfold
+        
         # The operation manipulates PyObjects
         self.pyobj = pyobj
 
@@ -111,18 +113,18 @@
 
     'int_is_true':          LLOp(canfold=True),
     'int_neg':              LLOp(canfold=True),
-    'int_neg_ovf':          LLOp(canfold=True, canraise=(OverflowError,)),
+    'int_neg_ovf':          LLOp(canraise=(OverflowError,)),
     'int_abs':              LLOp(canfold=True),
-    'int_abs_ovf':          LLOp(canfold=True, canraise=(OverflowError,)),
+    'int_abs_ovf':          LLOp(canraise=(OverflowError,)),
     'int_invert':           LLOp(canfold=True),
 
     'int_add':              LLOp(canfold=True),
     'int_sub':              LLOp(canfold=True),
     'int_mul':              LLOp(canfold=True),
     'int_floordiv':         LLOp(canfold=True),
-    'int_floordiv_zer':     LLOp(canfold=True, canraise=(ZeroDivisionError,)),
+    'int_floordiv_zer':     LLOp(canraise=(ZeroDivisionError,)),
     'int_mod':              LLOp(canfold=True),
-    'int_mod_zer':          LLOp(canfold=True, canraise=(ZeroDivisionError,)),
+    'int_mod_zer':          LLOp(canraise=(ZeroDivisionError,)),
     'int_lt':               LLOp(canfold=True),
     'int_le':               LLOp(canfold=True),
     'int_eq':               LLOp(canfold=True),
@@ -132,20 +134,20 @@
     'int_and':              LLOp(canfold=True),
     'int_or':               LLOp(canfold=True),
     'int_lshift':           LLOp(canfold=True),
-    'int_lshift_val':       LLOp(canfold=True, canraise=(ValueError,)),
+    'int_lshift_val':       LLOp(canraise=(ValueError,)),
     'int_rshift':           LLOp(canfold=True),
-    'int_rshift_val':       LLOp(canfold=True, canraise=(ValueError,)),
+    'int_rshift_val':       LLOp(canraise=(ValueError,)),
     'int_xor':              LLOp(canfold=True),
 
-    'int_add_ovf':          LLOp(canfold=True, canraise=(OverflowError,)),
-    'int_sub_ovf':          LLOp(canfold=True, canraise=(OverflowError,)),
-    'int_mul_ovf':          LLOp(canfold=True, canraise=(OverflowError,)),
-    'int_floordiv_ovf':     LLOp(canfold=True, canraise=(OverflowError,)),
-    'int_floordiv_ovf_zer': LLOp(canfold=True, canraise=(OverflowError, ZeroDivisionError)),
-    'int_mod_ovf':          LLOp(canfold=True, canraise=(OverflowError,)),
-    'int_mod_ovf_zer':      LLOp(canfold=True, canraise=(OverflowError, ZeroDivisionError)),
-    'int_lshift_ovf':       LLOp(canfold=True, canraise=(OverflowError,)),
-    'int_lshift_ovf_val':   LLOp(canfold=True, canraise=(OverflowError, ValueError,)),
+    'int_add_ovf':          LLOp(canraise=(OverflowError,)),
+    'int_sub_ovf':          LLOp(canraise=(OverflowError,)),
+    'int_mul_ovf':          LLOp(canraise=(OverflowError,)),
+    'int_floordiv_ovf':     LLOp(canraise=(OverflowError,)),
+    'int_floordiv_ovf_zer': LLOp(canraise=(OverflowError, ZeroDivisionError)),
+    'int_mod_ovf':          LLOp(canraise=(OverflowError,)),
+    'int_mod_ovf_zer':      LLOp(canraise=(OverflowError, ZeroDivisionError)),
+    'int_lshift_ovf':       LLOp(canraise=(OverflowError,)),
+    'int_lshift_ovf_val':   LLOp(canraise=(OverflowError, ValueError,)),
 
     'uint_is_true':         LLOp(canfold=True),
     'uint_neg':             LLOp(canfold=True),
@@ -156,9 +158,9 @@
     'uint_sub':             LLOp(canfold=True),
     'uint_mul':             LLOp(canfold=True),
     'uint_floordiv':        LLOp(canfold=True),
-    'uint_floordiv_zer':    LLOp(canfold=True, canraise=(ZeroDivisionError,)),
+    'uint_floordiv_zer':    LLOp(canraise=(ZeroDivisionError,)),
     'uint_mod':             LLOp(canfold=True),
-    'uint_mod_zer':         LLOp(canfold=True, canraise=(ZeroDivisionError,)),
+    'uint_mod_zer':         LLOp(canraise=(ZeroDivisionError,)),
     'uint_lt':              LLOp(canfold=True),
     'uint_le':              LLOp(canfold=True),
     'uint_eq':              LLOp(canfold=True),
@@ -168,9 +170,9 @@
     'uint_and':             LLOp(canfold=True),
     'uint_or':              LLOp(canfold=True),
     'uint_lshift':          LLOp(canfold=True),
-    'uint_lshift_val':      LLOp(canfold=True, canraise=(ValueError,)),
+    'uint_lshift_val':      LLOp(canraise=(ValueError,)),
     'uint_rshift':          LLOp(canfold=True),
-    'uint_rshift_val':      LLOp(canfold=True, canraise=(ValueError,)),
+    'uint_rshift_val':      LLOp(canraise=(ValueError,)),
     'uint_xor':             LLOp(canfold=True),
 
     'float_is_true':        LLOp(canfold=True),
@@ -201,9 +203,9 @@
     'llong_sub':            LLOp(canfold=True),
     'llong_mul':            LLOp(canfold=True),
     'llong_floordiv':       LLOp(canfold=True),
-    'llong_floordiv_zer':   LLOp(canfold=True, canraise=(ZeroDivisionError,)),
+    'llong_floordiv_zer':   LLOp(canraise=(ZeroDivisionError,)),
     'llong_mod':            LLOp(canfold=True),
-    'llong_mod_zer':        LLOp(canfold=True, canraise=(ZeroDivisionError,)),
+    'llong_mod_zer':        LLOp(canraise=(ZeroDivisionError,)),
     'llong_lt':             LLOp(canfold=True),
     'llong_le':             LLOp(canfold=True),
     'llong_eq':             LLOp(canfold=True),
@@ -213,9 +215,9 @@
     'llong_and':            LLOp(canfold=True),
     'llong_or':             LLOp(canfold=True),
     'llong_lshift':         LLOp(canfold=True),
-    'llong_lshift_val':     LLOp(canfold=True, canraise=(ValueError,)),
+    'llong_lshift_val':     LLOp(canraise=(ValueError,)),
     'llong_rshift':         LLOp(canfold=True),
-    'llong_rshift_val':     LLOp(canfold=True, canraise=(ValueError,)),
+    'llong_rshift_val':     LLOp(canraise=(ValueError,)),
     'llong_xor':            LLOp(canfold=True),
 
     'ullong_is_true':       LLOp(canfold=True),
@@ -227,9 +229,9 @@
     'ullong_sub':           LLOp(canfold=True),
     'ullong_mul':           LLOp(canfold=True),
     'ullong_floordiv':      LLOp(canfold=True),
-    'ullong_floordiv_zer':  LLOp(canfold=True, canraise=(ZeroDivisionError,)),
+    'ullong_floordiv_zer':  LLOp(canraise=(ZeroDivisionError,)),
     'ullong_mod':           LLOp(canfold=True),
-    'ullong_mod_zer':       LLOp(canfold=True, canraise=(ZeroDivisionError,)),
+    'ullong_mod_zer':       LLOp(canraise=(ZeroDivisionError,)),
     'ullong_lt':            LLOp(canfold=True),
     'ullong_le':            LLOp(canfold=True),
     'ullong_eq':            LLOp(canfold=True),
@@ -239,9 +241,9 @@
     'ullong_and':           LLOp(canfold=True),
     'ullong_or':            LLOp(canfold=True),
     'ullong_lshift':        LLOp(canfold=True),
-    'ullong_lshift_val':    LLOp(canfold=True, canraise=(ValueError,)),
+    'ullong_lshift_val':    LLOp(canraise=(ValueError,)),
     'ullong_rshift':        LLOp(canfold=True),
-    'ullong_rshift_val':    LLOp(canfold=True, canraise=(ValueError,)),
+    'ullong_rshift_val':    LLOp(canraise=(ValueError,)),
     'ullong_xor':           LLOp(canfold=True),
 
     'cast_primitive':       LLOp(canfold=True),



More information about the Pypy-commit mailing list