|
@@ -282,14 +282,14 @@ and field dce c n stat =
|
|
|
with Not_found ->
|
|
|
if dce.debug then prerr_endline ("[DCE] Field " ^ n ^ " not found on " ^ (s_type_path c.cl_path)) else ())
|
|
|
|
|
|
-and mark_really_used_class c =
|
|
|
- if not (Meta.has Meta.ReallyUsed c.cl_meta) then
|
|
|
- c.cl_meta <- (Meta.ReallyUsed,[],c.cl_pos) :: c.cl_meta
|
|
|
+and mark_directly_used_class c =
|
|
|
+ if not (Meta.has Meta.DirectlyUsed c.cl_meta) then
|
|
|
+ c.cl_meta <- (Meta.DirectlyUsed,[],c.cl_pos) :: c.cl_meta
|
|
|
|
|
|
-and mark_really_used_mt mt =
|
|
|
+and mark_directly_used_mt mt =
|
|
|
match mt with
|
|
|
| TClassDecl c ->
|
|
|
- mark_really_used_class c
|
|
|
+ mark_directly_used_class c
|
|
|
| _ ->
|
|
|
()
|
|
|
|
|
@@ -298,7 +298,7 @@ and expr dce e =
|
|
|
match e.eexpr with
|
|
|
| TNew(c,pl,el) ->
|
|
|
mark_class dce c;
|
|
|
- mark_really_used_class c;
|
|
|
+ mark_directly_used_class c;
|
|
|
field dce c "new" false;
|
|
|
List.iter (expr dce) el;
|
|
|
List.iter (mark_t dce e.epos) pl;
|
|
@@ -308,11 +308,11 @@ and expr dce e =
|
|
|
| TCast(e, Some mt) ->
|
|
|
check_feature dce "typed_cast";
|
|
|
mark_mt dce mt;
|
|
|
- mark_really_used_mt mt;
|
|
|
+ mark_directly_used_mt mt;
|
|
|
expr dce e;
|
|
|
| TTypeExpr mt ->
|
|
|
mark_mt dce mt;
|
|
|
- mark_really_used_mt mt;
|
|
|
+ mark_directly_used_mt mt;
|
|
|
| TTry(e, vl) ->
|
|
|
expr dce e;
|
|
|
List.iter (fun (v,e) ->
|
|
@@ -582,9 +582,9 @@ let run com main full =
|
|
|
(* mark extern classes as really used if they are extended by non-extern ones *)
|
|
|
List.iter (function
|
|
|
| TClassDecl ({cl_extern = false; cl_super = Some ({cl_extern = true} as csup, _)}) ->
|
|
|
- mark_really_used_class csup
|
|
|
+ mark_directly_used_class csup
|
|
|
| TClassDecl ({cl_extern = false} as c) when c.cl_implements <> [] ->
|
|
|
- List.iter (fun (iface,_) -> if (iface.cl_extern) then mark_really_used_class iface) c.cl_implements;
|
|
|
+ List.iter (fun (iface,_) -> if (iface.cl_extern) then mark_directly_used_class iface) c.cl_implements;
|
|
|
| _ -> ()
|
|
|
) com.types;
|
|
|
|