Răsfoiți Sursa

Revert "[typer] remove verbose spam, instead check for @:debug.typing"

This reverts commit ad04d2d5071b32c416d20ff9845fea99972edd0a.

# Conflicts:
#	src/typing/macroContext.ml
#	src/typing/typeloadFields.ml
#	src/typing/typeloadParse.ml
Simon Krajewski 3 luni în urmă
părinte
comite
fcb12795f8

+ 4 - 1
src/typing/macroContext.ml

@@ -819,10 +819,13 @@ let load_macro' ctx display cpath f p =
 	fst (load_macro'' ctx.com (get_macro_context ctx) display cpath f p)
 
 let do_call_macro com api cpath name args p =
+	if com.verbose then Common.log com ("Calling macro " ^ s_type_path cpath ^ "." ^ name ^ " (" ^ p.pfile ^ ":" ^ string_of_int (Lexer.get_error_line p) ^ ")");
 	incr stats.s_macros_called;
 	let timer_level = Timer.level_from_define com.defines Define.MacroTimes in
 	let f = Interp.call_path (Interp.get_ctx()) ((fst cpath) @ [snd cpath]) name args in
-	macro_timer com.timer_ctx timer_level "execution" (Some (s_type_path cpath ^ "." ^ name)) f api
+	let r = macro_timer com.timer_ctx timer_level "execution" (Some (s_type_path cpath ^ "." ^ name)) f api in
+	if com.verbose then Common.log com ("Exiting macro " ^ s_type_path cpath ^ "." ^ name);
+	r
 
 let load_macro ctx com mctx api display cpath f p =
 	let meth,mloaded = load_macro'' com mctx display cpath f p in

+ 2 - 2
src/typing/typeloadFields.ml

@@ -754,7 +754,7 @@ module TypeBinding = struct
 			(* type constant init fields (issue #1956) *)
 			if not ctx.g.return_partial_type || (match fst e with EConst _ -> true | _ -> false) then begin
 				enter_field_typing_pass ctx.g ("bind_var_expression",fst ctx.c.curclass.cl_path @ [snd ctx.c.curclass.cl_path;ctx.f.curfield.cf_name]);
-				if (Meta.has (Meta.Custom ":debug.typing") (c.cl_meta @ cf.cf_meta)) then ctx.com.print (Printf.sprintf "Typing field %s.%s\n" (s_type_path c.cl_path) cf.cf_name);
+				if ctx.com.verbose then Common.log ctx.com ("Typing " ^ (if ctx.com.is_macro_context then "macro " else "") ^ s_type_path c.cl_path ^ "." ^ cf.cf_name);
 				let e = type_var_field ctx t e fctx.is_static fctx.is_display_field p in
 				let maybe_run_analyzer e = match e.eexpr with
 					| TConst _ | TLocal _ | TFunction _ -> e
@@ -831,7 +831,7 @@ module TypeBinding = struct
 		let ctx = TyperManager.clone_for_expr ctx_f fmode true in
 		let bind () =
 			incr stats.s_methods_typed;
-			if (Meta.has (Meta.Custom ":debug.typing") (c.cl_meta @ cf.cf_meta)) then ctx.com.print (Printf.sprintf "Typing method %s.%s\n" (s_type_path c.cl_path) cf.cf_name);
+			if ctx.com.verbose then Common.log ctx.com ("Typing " ^ (if ctx.com.is_macro_context then "macro " else "") ^ s_type_path c.cl_path ^ "." ^ cf.cf_name);
 			begin match ctx.com.platform with
 				| Jvm when is_java_native_function ctx cf.cf_meta cf.cf_pos ->
 					if e <> None then

+ 1 - 0
src/typing/typeloadParse.ml

@@ -52,6 +52,7 @@ let parse_file_from_lexbuf com file p lexbuf =
 		| _ ->
 			()
 	end;
+	Common.log com ("Parsed " ^ file);
 	parse_result
 
 let parse_file_from_lexbuf com file p lexbuf =