2
0
Эх сурвалжийг харах

rename @:reallyUsed to @:directlyUsed

Dan Korostelev 10 жил өмнө
parent
commit
c40bb588a3
5 өөрчлөгдсөн 14 нэмэгдсэн , 14 устгасан
  1. 1 1
      ast.ml
  2. 1 1
      common.ml
  3. 10 10
      dce.ml
  4. 1 1
      genjs.ml
  5. 1 1
      genpy.ml

+ 1 - 1
ast.ml

@@ -59,6 +59,7 @@ module Meta = struct
 		| Delegate
 		| Depend
 		| Deprecated
+		| DirectlyUsed
 		| DynamicObject
 		| Enum
 		| EnumConstructorParam
@@ -127,7 +128,6 @@ module Meta = struct
 		| Public
 		| PublicFields
 		| ReadOnly
-		| ReallyUsed
 		| RealPath
 		| Remove
 		| Require

+ 1 - 1
common.ml

@@ -381,6 +381,7 @@ module MetaInfo = struct
 		| Delegate -> ":delegate",("Automatically added by -net-lib on delegates",[Platform Cs; UsedOn TAbstract])
 		| Depend -> ":depend",("",[Platform Cpp])
 		| Deprecated -> ":deprecated",("Automatically added by -java-lib on class fields annotated with @Deprecated annotation. Has no effect on types compiled by Haxe.",[Platform Java; UsedOnEither [TClass;TEnum;TClassField]])
+		| DirectlyUsed -> ":directlyUsed",("Marks types that are directly referenced by non-extern code",[Internal])
 		| DynamicObject -> ":dynamicObject",("Used internally to identify the Dynamic Object implementation",[Platforms [Java;Cs]; UsedOn TClass; Internal])
 		| Enum -> ":enum",("Used internally to annotate a class that was generated from an enum",[Platforms [Java;Cs]; UsedOn TClass; Internal])
 		| EnumConstructorParam -> ":enumConstructorParam",("Used internally to annotate GADT type parameters",[UsedOn TClass; Internal])
@@ -449,7 +450,6 @@ module MetaInfo = struct
 		| Protected -> ":protected",("Marks a class field as being protected",[UsedOn TClassField])
 		| Property -> ":property",("Marks a property field to be compiled as a native C# property",[UsedOn TClassField;Platform Cs])
 		| ReadOnly -> ":readOnly",("Generates a field with the 'readonly' native keyword",[Platform Cs; UsedOn TClassField])
-		| ReallyUsed -> ":reallyUsed",("Marks types that are directly referenced by non-extern code",[Internal])
 		| RealPath -> ":realPath",("Internally used on @:native types to retain original path information",[Internal])
 		| Remove -> ":remove",("Causes an interface to be removed from all implementing classes before generation",[UsedOn TClass])
 		| Require -> ":require",("Allows access to a field only if the specified compiler flag is set",[HasParam "Compiler flag to check";UsedOn TClassField])

+ 10 - 10
dce.ml

@@ -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;
 

+ 1 - 1
genjs.ml

@@ -1160,7 +1160,7 @@ let generate_type ctx = function
 			()
 		else if not c.cl_extern then
 			generate_class ctx c
-		else if (Meta.has Meta.JsRequire c.cl_meta) && (Meta.has Meta.ReallyUsed c.cl_meta) then
+		else if (Meta.has Meta.JsRequire c.cl_meta) && (Meta.has Meta.DirectlyUsed c.cl_meta) then
 			generate_require ctx c
 		else if not ctx.js_flatten && Meta.has Meta.InitPackage c.cl_meta then
 			(match c.cl_path with

+ 1 - 1
genpy.ml

@@ -1920,7 +1920,7 @@ module Generator = struct
 	let gen_import ctx c =
 		gen_pre_code_meta ctx c.cl_meta;
 
-		if (Meta.has Meta.PythonImport c.cl_meta) && (Meta.has Meta.ReallyUsed c.cl_meta) then begin
+		if (Meta.has Meta.PythonImport c.cl_meta) && (Meta.has Meta.DirectlyUsed c.cl_meta) then begin
 			let _, args, mp = Meta.get Meta.PythonImport c.cl_meta in
 
 			let class_name = match c.cl_path with