Bläddra i källkod

no dce when -D doc-gen or -D no-dce !

Nicolas Cannasse 13 år sedan
förälder
incheckning
85e9b9ed27
4 ändrade filer med 6 tillägg och 3 borttagningar
  1. 2 0
      common.ml
  2. 1 0
      doc/all.hxml
  3. 2 2
      genxml.ml
  4. 1 1
      main.ml

+ 2 - 0
common.ml

@@ -179,6 +179,7 @@ module Define = struct
 		| PhpPrefix
 		| Dump
 		| DumpDependencies
+		| NoDce
 
 		| Last (* must be last *)
 
@@ -226,6 +227,7 @@ module Define = struct
 		| PhpPrefix -> ("php_prefix","Compiled with --php-prefix")
 		| Dump -> ("dump","Dump the complete typed AST for internal debugging")
 		| DumpDependencies -> ("dump_dependencies","Dump the classes dependencies")
+		| NoDce -> ("no_dce","Entirely disable dead code elimination")
 		| Last -> assert false
 
 end

+ 1 - 0
doc/all.hxml

@@ -1,6 +1,7 @@
 --no-output
 --macro ImportAll.run()
 -D haxe3
+-D doc-gen
 --each
 
 -neko all.n

+ 2 - 2
genxml.ml

@@ -194,8 +194,8 @@ let gen_type_decl com pos t =
 	| TAbstractDecl a ->
 		let doc = gen_doc_opt a.a_doc in
 		let meta = gen_meta a.a_meta in
-		let sub = (match a.a_sub with [] -> [] | l -> node "sub" [] [List.map gen_type l]) in
-		let super = (match a.a_super with [] -> [] | l -> node "super" [] [List.map gen_type l]) in		
+		let sub = (match a.a_sub with [] -> [] | l -> [node "sub" [] (List.map gen_type l)]) in
+		let super = (match a.a_super with [] -> [] | l -> [node "super" [] (List.map gen_type l)]) in		
 		node "abstract" (gen_type_params pos a.a_private (tpath t) a.a_types a.a_pos m) (sub @ super @ doc @ meta)
 
 let att_str att =

+ 1 - 1
main.ml

@@ -1054,7 +1054,7 @@ try
 		Codegen.post_process_end();
 		List.iter (fun f -> f()) (List.rev com.filters);
 		List.iter (Codegen.save_class_state tctx) com.types;
-		if not !gen_as3 then Dce.run com main (!full_dce && not !interp);
+		if not (!gen_as3 || Common.defined com Define.NoDce || Common.defined com Define.DocGen) then Dce.run com main (!full_dce && not !interp);
 		let type_filters = [
 			Codegen.check_private_path;
 			Codegen.remove_generic_base;