Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/deadCode.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@ let main_files = Hashtbl.create 256 (* names -> paths *)

(******** PROCESSING ********)

let is_deprecated value =
List.exists (fun (s,_) -> s.Location.txt = "ocaml.deprecated") value.Types.val_attributes

let rec collect_export ?(mod_type = false) path u stock = function

| Sig_value (id, ({Types.val_loc; val_type; _} as value))
when not val_loc.Location.loc_ghost && stock == decs ->
when not val_loc.Location.loc_ghost && not (is_deprecated value) && stock == decs ->
if !DeadFlag.exported.DeadFlag.print then export path u stock id val_loc;
let path = Ident.{id with name = id.name ^ "*"} :: path in
DeadObj.collect_export path u stock ~obj:val_type val_loc;
Expand Down