summaryrefslogtreecommitdiff
path: root/src/ExpressionsUtils.ml
blob: c3ccfb1545265dcab6da680e1dfd7aa38fe78207 (plain)
1
2
3
4
5
6
7
8
9
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