Browse Source

minor changes in pass debugging

Nicolas Cannasse 10 years ago
parent
commit
39d918246d
3 changed files with 9 additions and 2 deletions
  1. 7 0
      typecore.ml
  2. 1 1
      typeload.ml
  3. 1 1
      typer.ml

+ 7 - 0
typecore.ml

@@ -369,6 +369,9 @@ let rec flush_pass ctx p (where:string) =
 
 let make_pass ctx f = f
 
+let init_class_done ctx =
+	ctx.pass <- PTypeField
+
 let exc_protect ctx f (where:string) =
 	let rec r = ref (fun() ->
 		try
@@ -411,6 +414,10 @@ let context_ident ctx =
 let debug ctx str =
 	if Common.raw_defined ctx.com "cdebug" then prerr_endline (context_ident ctx ^ !delay_tabs ^ str)
 
+let init_class_done ctx =
+	debug ctx ("init_class_done " ^ Ast.s_type_path ctx.curclass.cl_path);
+	init_class_done ctx
+
 let ctx_pos ctx =
 	let inf = Ast.s_type_path ctx.m.curmod.m_path in
 	let inf = (match snd ctx.curclass.cl_path with "" -> inf | n when n = snd ctx.m.curmod.m_path -> inf | n -> inf ^ "." ^ n) in

+ 1 - 1
typeload.ml

@@ -2435,7 +2435,7 @@ let init_class ctx c p context_init herits fields =
 	| _ -> ());
 	(* push delays in reverse order so they will be run in correct order *)
 	List.iter (fun (ctx,r) ->
-		ctx.pass <- PTypeField;
+		init_class_done ctx;
 		(match r with
 		| None -> ()
 		| Some r -> delay ctx PTypeField (fun() -> ignore((!r)())))

+ 1 - 1
typer.ml

@@ -389,7 +389,7 @@ let eval ctx s =
 		| Some path -> path
 	in
 	ignore(Typeload.type_module ctx path_module "eval" decls p);
-	flush_pass ctx PBuildClass "load_module"
+	flush_pass ctx PBuildClass "eval"
 
 let parse_expr_string ctx s p inl =
 	let head = "class X{static function main() " in