From 52380b017c35cacc6428731c4149a5635889514b Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Tue, 12 Nov 2019 16:33:26 -0800 Subject: [PATCH] [sledge][NFC] Simplify Term rec module Summary: Remove one duplicate of auxilliary type definitions. Reviewed By: ngorogiannis Differential Revision: D18298141 fbshipit-source-id: cfc5076c3 --- sledge/src/llair/term.ml | 124 ++++++++++----------------------------- 1 file changed, 31 insertions(+), 93 deletions(-) diff --git a/sledge/src/llair/term.ml b/sledge/src/llair/term.ml index e9e4db10c..27dca5327 100644 --- a/sledge/src/llair/term.ml +++ b/sledge/src/llair/term.ml @@ -9,40 +9,40 @@ [@@@warning "+9"] +type op1 = + | Signed of {bits: int} + | Unsigned of {bits: int} + | Convert of {src: Typ.t; dst: Typ.t} + | Select of int +[@@deriving compare, equal, hash, sexp] + +type op2 = + | Eq + | Dq + | Lt + | Le + | Ord + | Uno + | Div + | Rem + | And + | Or + | Xor + | Shl + | Lshr + | Ashr + | Splat + | Memory + | Update of int +[@@deriving compare, equal, hash, sexp] + +type op3 = Conditional [@@deriving compare, equal, hash, sexp] +type opN = Concat | Record [@@deriving compare, equal, hash, sexp] +type recN = Record [@@deriving compare, equal, hash, sexp] + module rec T : sig type qset = Qset.M(T).t [@@deriving compare, equal, hash, sexp] - type op1 = - | Signed of {bits: int} - | Unsigned of {bits: int} - | Convert of {src: Typ.t; dst: Typ.t} - | Select of int - [@@deriving compare, equal, hash, sexp] - - type op2 = - | Eq - | Dq - | Lt - | Le - | Ord - | Uno - | Div - | Rem - | And - | Or - | Xor - | Shl - | Lshr - | Ashr - | Splat - | Memory - | Update of int - [@@deriving compare, equal, hash, sexp] - - type op3 = Conditional [@@deriving compare, equal, hash, sexp] - type opN = Concat | Record [@@deriving compare, equal, hash, sexp] - type recN = Record [@@deriving compare, equal, hash, sexp] - type t = | Add of qset | Mul of qset @@ -73,37 +73,6 @@ end and T0 : sig type qset = Qset.M(T).t [@@deriving compare, equal, hash, sexp] - type op1 = - | Signed of {bits: int} - | Unsigned of {bits: int} - | Convert of {src: Typ.t; dst: Typ.t} - | Select of int - [@@deriving compare, equal, hash, sexp] - - type op2 = - | Eq - | Dq - | Lt - | Le - | Ord - | Uno - | Div - | Rem - | And - | Or - | Xor - | Shl - | Lshr - | Ashr - | Splat - | Memory - | Update of int - [@@deriving compare, equal, hash, sexp] - - type op3 = Conditional [@@deriving compare, equal, hash, sexp] - type opN = Concat | Record [@@deriving compare, equal, hash, sexp] - type recN = Record [@@deriving compare, equal, hash, sexp] - type t = | Add of qset | Mul of qset @@ -121,37 +90,6 @@ and T0 : sig end = struct type qset = Qset.M(T).t [@@deriving compare, equal, hash, sexp] - type op1 = - | Signed of {bits: int} - | Unsigned of {bits: int} - | Convert of {src: Typ.t; dst: Typ.t} - | Select of int - [@@deriving compare, equal, hash, sexp] - - type op2 = - | Eq - | Dq - | Lt - | Le - | Ord - | Uno - | Div - | Rem - | And - | Or - | Xor - | Shl - | Lshr - | Ashr - | Splat - | Memory - | Update of int - [@@deriving compare, equal, hash, sexp] - - type op3 = Conditional [@@deriving compare, equal, hash, sexp] - type opN = Concat | Record [@@deriving compare, equal, hash, sexp] - type recN = Record [@@deriving compare, equal, hash, sexp] - type t = | Add of qset | Mul of qset