Skip to content

Commit

Permalink
Compiler: more cleanup in parse_bytecode
Browse files Browse the repository at this point in the history
  • Loading branch information
hhugo authored and vouillon committed Oct 23, 2024
1 parent 69ca702 commit 7cd112c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions compiler/lib/parse_bytecode.ml
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,11 @@ end = struct
; source : path option
}

module String_table = Hashtbl.Make (String)
module Int_table = Hashtbl.Make (Int)

type t =
{ events_by_pc : event_and_source Int_table.t
; units : (string * string option, ml_unit) Hashtbl.t
; pos_fname_to_source : string String_table.t
; names : bool
; enabled : bool
; include_cmis : bool
Expand All @@ -137,7 +135,6 @@ end = struct
let names = enabled || Config.Flag.pretty () in
{ events_by_pc = Int_table.create 17
; units = Hashtbl.create 17
; pos_fname_to_source = String_table.create 17
; names
; enabled
; include_cmis
Expand All @@ -155,7 +152,7 @@ end = struct
~paths
~crcs
~orig
{ events_by_pc; units; pos_fname_to_source; names; enabled; include_cmis = _ }
{ events_by_pc; units; names; enabled; include_cmis = _ }
ev =
let pos_fname =
match ev.ev_loc.Location.loc_start.Lexing.pos_fname with
Expand Down Expand Up @@ -200,10 +197,6 @@ end = struct
| None -> "NONE"
| Some x -> x);
let u = { module_name = ev_module; crc; source; paths } in
(match pos_fname, source with
| None, _ | _, None -> ()
| Some pos_fname, Some source ->
String_table.add pos_fname_to_source pos_fname source);
Hashtbl.add units (ev_module, pos_fname) u;
u
in
Expand Down

0 comments on commit 7cd112c

Please sign in to comment.