From b314e3545a4c6eaa8017cf93557e4f41d9e920b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Mon, 23 Sep 2024 19:32:16 +0200 Subject: [PATCH] Remove code which is no longer used --- compiler/lib/code.ml | 42 ------------------------------------------ compiler/lib/code.mli | 12 ------------ 2 files changed, 54 deletions(-) diff --git a/compiler/lib/code.ml b/compiler/lib/code.ml index b1b517d8f3..c0c0ed5860 100644 --- a/compiler/lib/code.ml +++ b/compiler/lib/code.ml @@ -110,14 +110,6 @@ module Var : sig val fold : ('a -> 'acc -> 'acc) -> 'a t -> 'acc -> 'acc end - module DataMap : sig - type ('a, 'b) t - - val iter : ('a -> 'b -> unit) -> ('a, 'b) t -> unit - - val fold : ('a -> 'b -> 'acc -> 'acc) -> ('a, 'b) t -> 'acc -> 'acc - end - type size = unit val get : 'a t -> key -> 'a @@ -126,12 +118,8 @@ module Var : sig val make : size -> 'a -> 'a t - val make_map : size -> ('a, 'b) DataMap.t t - val make_set : size -> 'a DataSet.t t - val add_map : ('a, 'b) DataMap.t t -> key -> 'a -> 'b -> unit - val add_set : 'a DataSet.t t -> key -> 'a -> unit val iter : (key -> 'a -> unit) -> 'a t -> unit @@ -250,24 +238,6 @@ end = struct | Many t -> Hashtbl.fold (fun k () acc -> f k acc) t acc end - module DataMap = struct - type ('a, 'b) t = - | Empty - | One of 'a * 'b - | Many of ('a, 'b) Hashtbl.t - - let iter f = function - | Empty -> () - | One (a, b) -> f a b - | Many t -> Hashtbl.iter f t - - let fold f t acc = - match t with - | Empty -> acc - | One (a, b) -> f a b acc - | Many t -> Hashtbl.fold f t acc - end - type key = T.t type size = unit @@ -280,18 +250,6 @@ end = struct let make_set () = Array.make (count ()) DataSet.Empty - let make_map () = Array.make (count ()) DataMap.Empty - - let add_map t x k v = - match t.(x) with - | DataMap.Empty -> t.(x) <- One (k, v) - | One (k', v') -> - let tbl = Hashtbl.create 0 in - Hashtbl.replace tbl k' v'; - Hashtbl.replace tbl k v; - t.(x) <- Many tbl - | Many tbl -> Hashtbl.replace tbl k v - let add_set t x k = match t.(x) with | DataSet.Empty -> t.(x) <- One k diff --git a/compiler/lib/code.mli b/compiler/lib/code.mli index e30d22daa1..7fc2540228 100644 --- a/compiler/lib/code.mli +++ b/compiler/lib/code.mli @@ -101,14 +101,6 @@ module Var : sig val fold : ('a -> 'acc -> 'acc) -> 'a t -> 'acc -> 'acc end - module DataMap : sig - type ('a, 'b) t - - val iter : ('a -> 'b -> unit) -> ('a, 'b) t -> unit - - val fold : ('a -> 'b -> 'acc -> 'acc) -> ('a, 'b) t -> 'acc -> 'acc - end - type 'a t type size = unit @@ -119,12 +111,8 @@ module Var : sig val make : size -> 'a -> 'a t - val make_map : size -> ('a, 'b) DataMap.t t - val make_set : size -> 'a DataSet.t t - val add_map : ('a, 'b) DataMap.t t -> key -> 'a -> 'b -> unit - val add_set : 'a DataSet.t t -> key -> 'a -> unit val iter : (key -> 'a -> unit) -> 'a t -> unit