Browse Source

[dce] check type features too and use IntMap.* on its h field

Simon Krajewski 11 years ago
parent
commit
8d3ccc576c
2 changed files with 4 additions and 1 deletions
  1. 3 0
      dce.ml
  2. 1 1
      std/cpp/_std/haxe/ds/IntMap.hx

+ 3 - 0
dce.ml

@@ -130,15 +130,18 @@ let rec update_marked_class_fields dce c =
 (* mark a class as kept. If the class has fields marked as @:?keep, make sure to keep them *)
 and mark_class dce c = if not (Meta.has Meta.Used c.cl_meta) then begin
 	c.cl_meta <- (Meta.Used,[],c.cl_pos) :: c.cl_meta;
+	check_feature dce (Printf.sprintf "%s.*" (s_type_path c.cl_path));
 	update_marked_class_fields dce c;
 end
 
 let rec mark_enum dce e = if not (Meta.has Meta.Used e.e_meta) then begin
 	e.e_meta <- (Meta.Used,[],e.e_pos) :: e.e_meta;
+	check_feature dce (Printf.sprintf "%s.*" (s_type_path e.e_path));
 	PMap.iter (fun _ ef -> mark_t dce ef.ef_pos ef.ef_type) e.e_constrs;
 end
 
 and mark_abstract dce a = if not (Meta.has Meta.Used a.a_meta) then
+	check_feature dce (Printf.sprintf "%s.*" (s_type_path a.a_path));
 	a.a_meta <- (Meta.Used,[],a.a_pos) :: a.a_meta
 
 (* mark a type as kept *)

+ 1 - 1
std/cpp/_std/haxe/ds/IntMap.hx

@@ -40,7 +40,7 @@ package haxe.ds;
 ")
 @:coreApi class IntMap<T> implements haxe.Constraints.IMap<Int,T> {
 
-	@:ifFeature("haxe.ds.IntMap.new") private var h : Dynamic;
+	@:ifFeature("haxe.ds.IntMap.*") private var h : Dynamic;
 
 	public function new() : Void { }