Browse Source

write errors to stdout instead of stderr because our output goes to stderr instead of stdout

Don't ask me
Simon Krajewski 8 years ago
parent
commit
67a3f2f287
2 changed files with 11 additions and 11 deletions
  1. 5 5
      src/optimization/analyzer.ml
  2. 6 6
      src/optimization/analyzerTypes.ml

+ 5 - 5
src/optimization/analyzer.ml

@@ -978,14 +978,14 @@ module Run = struct
 			(match e.eexpr with TFunction tf -> cf.cf_expr_unoptimized <- Some tf | _ -> ());
 			let actx = create_analyzer_context ctx.Typecore.com config e in
 			let debug() =
-				prerr_endline (Printf.sprintf "While analyzing %s.%s" (s_type_path c.cl_path) cf.cf_name);
+				print_endline (Printf.sprintf "While analyzing %s.%s" (s_type_path c.cl_path) cf.cf_name);
 				List.iter (fun (s,e) ->
-					prerr_endline (Printf.sprintf "<%s>" s);
-					prerr_endline (Type.s_expr_pretty true "" false (s_type (print_context())) e);
-					prerr_endline (Printf.sprintf "</%s>" s);
+					print_endline (Printf.sprintf "<%s>" s);
+					print_endline (Type.s_expr_pretty true "" false (s_type (print_context())) e);
+					print_endline (Printf.sprintf "</%s>" s);
 				) (List.rev actx.debug_exprs);
 				Debug.dot_debug actx c cf;
-				prerr_endline (Printf.sprintf "dot graph written to %s" (String.concat "/" (Debug.get_dump_path actx c cf)));
+				print_endline (Printf.sprintf "dot graph written to %s" (String.concat "/" (Debug.get_dump_path actx c cf)));
 			in
 			let e = try
 				run_on_expr actx e

+ 6 - 6
src/optimization/analyzerTypes.ml

@@ -216,8 +216,8 @@ module Graph = struct
 	let get_var_info g v = match v.v_extra with
 		| Some(_,Some {eexpr = TConst (TInt i32)}) -> DynArray.get g.g_var_infos (Int32.to_int i32)
 		| _ ->
-			prerr_endline "Unbound variable, please report this";
-			prerr_endline (Printer.s_tvar v);
+			print_endline "Unbound variable, please report this";
+			print_endline (Printer.s_tvar v);
 			assert false
 
 	let declare_var g v bb =
@@ -311,15 +311,15 @@ module Graph = struct
 		List.iter (fun bb ->
 			List.iter (fun edge ->
 				if edge.cfg_to = g.g_unreachable then
-					prerr_endline (Printf.sprintf "Outgoing edge from %i to the unreachable block" bb.bb_id)
+					print_endline (Printf.sprintf "Outgoing edge from %i to the unreachable block" bb.bb_id)
 				else if not (List.memq edge edge.cfg_to.bb_incoming) then
-					prerr_endline (Printf.sprintf "Outgoing edge %i -> %i has no matching incoming edge" edge.cfg_from.bb_id edge.cfg_to.bb_id)
+					print_endline (Printf.sprintf "Outgoing edge %i -> %i has no matching incoming edge" edge.cfg_from.bb_id edge.cfg_to.bb_id)
 			) bb.bb_outgoing;
 			List.iter (fun edge ->
 				if edge.cfg_from == g.g_unreachable then
-					prerr_endline (Printf.sprintf "Incoming edge to %i from the unreachable block" bb.bb_id)
+					print_endline (Printf.sprintf "Incoming edge to %i from the unreachable block" bb.bb_id)
 				else if not (List.memq edge edge.cfg_from.bb_outgoing) then
-					prerr_endline (Printf.sprintf "Incoming edge %i <- %i has no matching outgoing edge" edge.cfg_to.bb_id edge.cfg_from.bb_id)
+					print_endline (Printf.sprintf "Incoming edge %i <- %i has no matching outgoing edge" edge.cfg_to.bb_id edge.cfg_from.bb_id)
 			) bb.bb_incoming
 		) g.g_nodes