diff options
Diffstat (limited to 'compiler/ExpressionsUtils.ml')
-rw-r--r-- | compiler/ExpressionsUtils.ml | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/ExpressionsUtils.ml b/compiler/ExpressionsUtils.ml new file mode 100644 index 00000000..c3ccfb15 --- /dev/null +++ b/compiler/ExpressionsUtils.ml @@ -0,0 +1,10 @@ +module E = Expressions + +let unop_can_fail (unop : E.unop) : bool = + match unop with Neg | Cast _ -> true | Not -> false + +let binop_can_fail (binop : E.binop) : bool = + match binop with + | BitXor | BitAnd | BitOr | Eq | Lt | Le | Ne | Ge | Gt -> false + | Div | Rem | Add | Sub | Mul -> true + | Shl | Shr -> raise Errors.Unimplemented |