Skip to content

Commit

Permalink
Remove now useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Dec 12, 2024
1 parent 478563d commit ff8caa2
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/compiler/hxb/hxbWriter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,6 @@ type hxb_writer = {
docs : StringPool.t;
mutable chunk : Chunk.t;

mutable minimal : bool;
mutable deps : module_def list;

classes : (path,tclass) Pool.t;
enums : (path,tenum) Pool.t;
typedefs : (path,tdef) Pool.t;
Expand Down Expand Up @@ -869,28 +866,20 @@ module HxbWriter = struct

(* References *)

let maybe_add_sig_dep writer m =
if m.m_path <> writer.current_module.m_path && not (List.exists (fun m' -> m'.m_path = m.m_path) writer.deps) then
writer.deps <- m :: writer.deps

let write_class_ref writer (c : tclass) =
let i = Pool.get_or_add writer.classes c.cl_path c in
maybe_add_sig_dep writer c.cl_module;
Chunk.write_uleb128 writer.chunk i

let write_enum_ref writer (en : tenum) =
let i = Pool.get_or_add writer.enums en.e_path en in
maybe_add_sig_dep writer en.e_module;
Chunk.write_uleb128 writer.chunk i

let write_typedef_ref writer (td : tdef) =
let i = Pool.get_or_add writer.typedefs td.t_path td in
maybe_add_sig_dep writer td.t_module;
Chunk.write_uleb128 writer.chunk i

let write_abstract_ref writer (a : tabstract) =
let i = Pool.get_or_add writer.abstracts a.a_path a in
maybe_add_sig_dep writer a.a_module;
Chunk.write_uleb128 writer.chunk i

let write_tmono_ref writer (mono : tmono) =
Expand Down Expand Up @@ -1795,9 +1784,6 @@ module HxbWriter = struct
maybe_write_documentation writer cf.cf_doc;
write_field_kind writer cf.cf_kind;
let expr_chunk = match cf.cf_expr with
| _ when writer.minimal ->
Chunk.write_u8 writer.chunk 0;
None
| None ->
Chunk.write_u8 writer.chunk 0;
None
Expand Down Expand Up @@ -2282,12 +2268,6 @@ module HxbWriter = struct
l
end

let get_dependencies writer =
List.fold_left (fun deps mdep ->
let dep = {md_sign = mdep.m_extra.m_sign; md_path = mdep.m_path; md_kind = mdep.m_extra.m_kind; md_origin = MDepFromTyping} in
PMap.add mdep.m_id dep deps;
) PMap.empty writer.deps

let create config string_pool warn anon_id =
let cp,has_own_string_pool = match string_pool with
| None ->
Expand All @@ -2303,8 +2283,6 @@ let create config string_pool warn anon_id =
chunks = DynArray.create ();
cp = cp;
has_own_string_pool;
deps = [];
minimal = false;
docs = StringPool.create ();
chunk = Obj.magic ();
classes = Pool.create ();
Expand Down

0 comments on commit ff8caa2

Please sign in to comment.