Skip to content

Commit

Permalink
Remove code which is no longer used
Browse files Browse the repository at this point in the history
  • Loading branch information
vouillon committed Sep 23, 2024
1 parent f9c5b7e commit ed8e401
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 54 deletions.
42 changes: 0 additions & 42 deletions compiler/lib/code.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 0 additions & 12 deletions compiler/lib/code.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ed8e401

Please sign in to comment.