fix(build): remove [@inline] attributes since they break on 4.02.3

This commit is contained in:
Simon Cruanes 2018-06-11 19:01:06 -05:00
parent 3e5813d72f
commit aa4b2a4680
2 changed files with 35 additions and 35 deletions

View file

@ -23,11 +23,11 @@ type 'a ktree = unit -> [`Nil | `Node of 'a * 'a ktree list]
module Transient = struct module Transient = struct
type t = { mutable frozen: bool } type t = { mutable frozen: bool }
let empty = {frozen=true} (* special value *) let empty = {frozen=true} (* special value *)
let[@inline] equal a b = Pervasives.(==) a b let equal a b = Pervasives.(==) a b
let[@inline] create () = {frozen=false} let create () = {frozen=false}
let[@inline] active st =not st.frozen let active st =not st.frozen
let[@inline] frozen st = st.frozen let frozen st = st.frozen
let[@inline] freeze st = st.frozen <- true let freeze st = st.frozen <- true
let with_ f = let with_ f =
let r = create() in let r = create() in
try try
@ -302,9 +302,9 @@ module A_SPARSE = struct
{a with bits; arr} {a with bits; arr}
) )
let[@inline] iter f a = Array.iter f a.arr let iter f a = Array.iter f a.arr
let[@inline] fold f acc a = Array.fold_left f acc a.arr let fold f acc a = Array.fold_left f acc a.arr
end end
(** {2 Functors} *) (** {2 Functors} *)
@ -328,10 +328,10 @@ module Make(Key : KEY)
type t = int type t = int
let make = Key.hash let make = Key.hash
let zero = 0 let zero = 0
let[@inline] is_0 h = h = 0 let is_0 h = h = 0
let[@inline] equal : int -> int -> bool = Pervasives.(=) let equal : int -> int -> bool = Pervasives.(=)
let[@inline] rem h = h land (A.length - 1) let rem h = h land (A.length - 1)
let[@inline] quotient h = h lsr A.length_log let quotient h = h lsr A.length_log
end end
let hash_ = Hash.make let hash_ = Hash.make
@ -368,7 +368,7 @@ module Make(Key : KEY)
M.is_empty M.empty M.is_empty M.empty
*) *)
let[@inline] leaf_ k v ~h = L (h, Cons(k,v,Nil)) let leaf_ k v ~h = L (h, Cons(k,v,Nil))
let singleton k v = leaf_ k v ~h:(hash_ k) let singleton k v = leaf_ k v ~h:(hash_ k)
@ -399,7 +399,7 @@ module Make(Key : KEY)
get_exn_ k ~h:h' (A.get ~default:E a i) get_exn_ k ~h:h' (A.get ~default:E a i)
) )
let[@inline] get_exn k m = get_exn_ k ~h:(hash_ k) m let get_exn k m = get_exn_ k ~h:(hash_ k) m
(*$Q (*$Q
_listuniq (fun l -> \ _listuniq (fun l -> \
@ -431,7 +431,7 @@ module Make(Key : KEY)
then Cons (k, v, tail) (* replace *) then Cons (k, v, tail) (* replace *)
else Cons (k', v', add_list_ k v tail) else Cons (k', v', add_list_ k v tail)
let[@inline] node_ leaf a = N (leaf, a) let node_ leaf a = N (leaf, a)
(* [h]: hash, with the part required to reach this leaf removed (* [h]: hash, with the part required to reach this leaf removed
[id] is the transient ID used for mutability *) [id] is the transient ID used for mutability *)
@ -483,7 +483,7 @@ module Make(Key : KEY)
let h' = Hash.quotient h in let h' = Hash.quotient h in
A.update ~default:E ~mut a i (fun x -> add_ ~id k v ~h:h' x) A.update ~default:E ~mut a i (fun x -> add_ ~id k v ~h:h' x)
let[@inline] add k v m = add_ ~id:Transient.empty k v ~h:(hash_ k) m let add k v m = add_ ~id:Transient.empty k v ~h:(hash_ k) m
(*$Q (*$Q
_listuniq (fun l -> \ _listuniq (fun l -> \
@ -491,7 +491,7 @@ module Make(Key : KEY)
List.for_all (fun (x,y) -> M.get_exn x m = y) l) List.for_all (fun (x,y) -> M.get_exn x m = y) l)
*) *)
let[@inline] add_mut ~id k v m = let add_mut ~id k v m =
if Transient.frozen id then raise Transient.Frozen; if Transient.frozen id then raise Transient.Frozen;
add_ ~id k v ~h:(hash_ k) m add_ ~id k v ~h:(hash_ k) m
@ -563,9 +563,9 @@ module Make(Key : KEY)
then E then E
else N (leaf, a) else N (leaf, a)
let[@inline] remove k m = remove_rec_ ~id:Transient.empty k ~h:(hash_ k) m let remove k m = remove_rec_ ~id:Transient.empty k ~h:(hash_ k) m
let[@inline] remove_mut ~id k m = let remove_mut ~id k m =
if Transient.frozen id then raise Transient.Frozen; if Transient.frozen id then raise Transient.Frozen;
remove_rec_ ~id k ~h:(hash_ k) m remove_rec_ ~id k ~h:(hash_ k) m
@ -594,9 +594,9 @@ module Make(Key : KEY)
| Some _, None -> remove_rec_ ~id k ~h m | Some _, None -> remove_rec_ ~id k ~h m
end end
let[@inline] update k ~f m = update_ ~id:Transient.empty k f m let update k ~f m = update_ ~id:Transient.empty k f m
let[@inline] update_mut ~id k ~f m = let update_mut ~id k ~f m =
if Transient.frozen id then raise Transient.Frozen; if Transient.frozen id then raise Transient.Frozen;
update_ ~id k f m update_ ~id k f m
@ -650,13 +650,13 @@ module Make(Key : KEY)
let to_list m = fold ~f:(fun acc k v -> (k,v)::acc) ~x:[] m let to_list m = fold ~f:(fun acc k v -> (k,v)::acc) ~x:[] m
let[@inline] add_list_mut ~id m l = let add_list_mut ~id m l =
List.fold_left (fun acc (k,v) -> add_mut ~id k v acc) m l List.fold_left (fun acc (k,v) -> add_mut ~id k v acc) m l
let[@inline] add_list m l = let add_list m l =
Transient.with_ (fun id -> add_list_mut ~id m l) Transient.with_ (fun id -> add_list_mut ~id m l)
let[@inline] of_list l = add_list empty l let of_list l = add_list empty l
let add_seq_mut ~id m seq = let add_seq_mut ~id m seq =
let m = ref m in let m = ref m in
@ -666,7 +666,7 @@ module Make(Key : KEY)
let add_seq m seq = let add_seq m seq =
Transient.with_ (fun id -> add_seq_mut ~id m seq) Transient.with_ (fun id -> add_seq_mut ~id m seq)
let[@inline] of_seq s = add_seq empty s let of_seq s = add_seq empty s
let to_seq m yield = iter ~f:(fun k v -> yield (k,v)) m let to_seq m yield = iter ~f:(fun k v -> yield (k,v)) m
@ -684,7 +684,7 @@ module Make(Key : KEY)
let add_gen m g = let add_gen m g =
Transient.with_ (fun id -> add_gen_mut ~id m g) Transient.with_ (fun id -> add_gen_mut ~id m g)
let[@inline] of_gen g = add_gen empty g let of_gen g = add_gen empty g
(* traverse the tree by increasing hash order, where the order compares (* traverse the tree by increasing hash order, where the order compares
hashes lexicographically by A.length_log-wide chunks of bits, hashes lexicographically by A.length_log-wide chunks of bits,
@ -721,7 +721,7 @@ module Make(Key : KEY)
|> List.sort Pervasives.compare) ) |> List.sort Pervasives.compare) )
*) *)
let[@inline] choose m = to_gen m () let choose m = to_gen m ()
(*$T (*$T
M.choose M.empty = None M.choose M.empty = None

View file

@ -46,14 +46,14 @@ end = struct
highest_bit_naive x 1 highest_bit_naive x 1
) )
let[@inline] is_0 ~bit x = x land bit = 0 let is_0 ~bit x = x land bit = 0
let[@inline] is_1 ~bit x = x land bit = bit let is_1 ~bit x = x land bit = bit
let[@inline] mask ~mask x = (x lor (mask -1)) land (lnot mask) let mask ~mask x = (x lor (mask -1)) land (lnot mask)
(* low endian: let mask_ x ~mask = x land (mask - 1) *) (* low endian: let mask_ x ~mask = x land (mask - 1) *)
let[@inline] gt a b = (b != min_int) && (a = min_int || a > b) let gt a b = (b != min_int) && (a = min_int || a > b)
let[@inline] lt a b = gt b a let lt a b = gt b a
let equal_int = Pervasives.(=) let equal_int = Pervasives.(=)
end end
@ -80,7 +80,7 @@ type 'a t =
let empty = E let empty = E
let[@inline] is_prefix_ ~prefix y ~bit = let is_prefix_ ~prefix y ~bit =
prefix = Bit.mask y ~mask:bit prefix = Bit.mask y ~mask:bit
(*$inject (*$inject
@ -113,7 +113,7 @@ let[@inline] is_prefix_ ~prefix y ~bit =
*) *)
(* low endian: let branching_bit_ a _ b _ = lowest_bit_ (a lxor b) *) (* low endian: let branching_bit_ a _ b _ = lowest_bit_ (a lxor b) *)
let[@inline] branching_bit_ a b = Bit.highest (a lxor b) let branching_bit_ a b = Bit.highest (a lxor b)
(* TODO use hint in branching_bit_ *) (* TODO use hint in branching_bit_ *)
@ -183,7 +183,7 @@ let mem k t =
List.for_all (fun (k,_) -> mem k m) l) List.for_all (fun (k,_) -> mem k m) l)
*) *)
let[@inline] mk_node_ prefix switch l r = match l, r with let mk_node_ prefix switch l r = match l, r with
| E, o | o, E -> o | E, o | o, E -> o
| _ -> N (prefix, switch, l, r) | _ -> N (prefix, switch, l, r)
@ -200,7 +200,7 @@ let join_ t1 p1 t2 p2 =
mk_node_ prefix switch t2 t1 mk_node_ prefix switch t2 t1
) )
let[@inline] singleton k v = L (k, v) let singleton k v = L (k, v)
(* c: conflict function *) (* c: conflict function *)
let rec insert_ c k v t = match t with let rec insert_ c k v t = match t with