Browse Source

[analyzer] make fusion debug output accurate again [skip ci]

Simon Krajewski 9 năm trước cách đây
mục cha
commit
decbe5fa7d
1 tập tin đã thay đổi với 7 bổ sung2 xóa
  1. 7 2
      src/optimization/analyzerTexpr.ml

+ 7 - 2
src/optimization/analyzerTexpr.ml

@@ -409,8 +409,13 @@ module Fusion = struct
 			        can_be_used_as_value com e &&
 			        (Meta.has Meta.CompilerGenerated v.v_meta || config.optimize && config.fusion && config.user_var_fusion && type_change_ok com v.v_type e.etype && v.v_extra = None)
 			in
-			(* let st = s_type (print_context()) in *)
-			(* if e.epos.pfile = "src/Main.hx" then print_endline (Printf.sprintf "%s: %i %i %b %s %s (%b %b %b %b %b) -> %b" v.v_name (get_num_uses v) (get_num_writes v) (can_be_used_as_value com e) (st v.v_type) (st e.etype) (Meta.has Meta.CompilerGenerated v.v_meta) config.Config.optimize config.Config.fusion (type_change_ok com v.v_type e.etype) (v.v_extra = None) b); *)
+(* 			let st = s_type (print_context()) in
+			if e.epos.pfile = "src/Main.hx" then
+				print_endline (Printf.sprintf "%s(%s) -> %s: #uses=%i && #writes=%i && used_as_value=%b && (compiler-generated=%b || optimize=%b && fusion=%b && user_var_fusion=%b && type_change_ok=%b && v_extra=%b) -> %b"
+					v.v_name (st v.v_type) (st e.etype)
+					(get_num_uses v) (get_num_writes v) (can_be_used_as_value com e)
+					(Meta.has Meta.CompilerGenerated v.v_meta) config.optimize config.fusion
+					config.user_var_fusion (type_change_ok com v.v_type e.etype) (v.v_extra = None) b); *)
 			b
 		in
 		let rec fuse acc el = match el with