diff: passes_aux.m exit status bug fix

Fergus Henderson fjh at cs.mu.oz.au
Wed Jun 11 18:29:00 AEST 1997


compiler/passes_aux.m:
	If we encounter an error (or a warning, if --halt-at-warn),
	then call io__exit_status(1).

compiler/mercury_compile.m:
	Fix a warning about `condition of if-then-else can never fail'.

compiler/instmap.m:
	Fix a warning about an unused interface import:
	delete `import_module hlds_module', since it's not needed.

cvs diff: Diffing .
Index: instmap.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/instmap.m,v
retrieving revision 1.7
diff -u -r1.7 instmap.m
--- instmap.m	1997/05/08 06:46:53	1.7
+++ instmap.m	1997/06/01 13:52:46
@@ -18,7 +18,7 @@
 :- module instmap.
 
 :- interface.
-:- import_module hlds_module, prog_data, mode_info.
+:- import_module prog_data, mode_info.
 :- import_module set.
 
 :- type instmap.
Index: mercury_compile.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/mercury_compile.m,v
retrieving revision 1.42
diff -u -r1.42 mercury_compile.m
--- mercury_compile.m	1997/06/05 06:31:31	1.42
+++ mercury_compile.m	1997/06/11 08:04:10
@@ -1052,17 +1052,12 @@
 :- mode mercury_compile__maybe_base_type_infos(in, in, in, out, di, uo) is det.
 
 mercury_compile__maybe_base_type_infos(HLDS0, Verbose, Stats, HLDS) -->
-	globals__io_get_type_info_method(TypeInfoMethod),
-	( { TypeInfoMethod = shared_one_or_two_cell } ->
-		maybe_write_string(Verbose,
-			"% Generating base_type_info structures..."),
-		maybe_flush_output(Verbose),
-		{ base_type_info__generate_hlds(HLDS0, HLDS) },
-		maybe_write_string(Verbose, " done.\n"),
-		maybe_report_stats(Stats)
-	;
-		{ HLDS = HLDS0 }
-	).
+	maybe_write_string(Verbose,
+		"% Generating base_type_info structures..."),
+	maybe_flush_output(Verbose),
+	{ base_type_info__generate_hlds(HLDS0, HLDS) },
+	maybe_write_string(Verbose, " done.\n"),
+	maybe_report_stats(Stats).
 
 	% We only add base_type_layouts if shared-one-or-two-cell
 	% type_infos are being used (the layouts refer to the
Index: passes_aux.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/passes_aux.m,v
retrieving revision 1.18
diff -u -r1.18 passes_aux.m
--- passes_aux.m	1997/05/16 04:34:37	1.18
+++ passes_aux.m	1997/06/11 08:22:26
@@ -167,7 +167,7 @@
 		call(Closure, PredId, ProcId, ModuleInfo0, ModuleInfo1,
 			Proc0, Proc, WarnCnt, ErrCnt, State0, State1),
 		globals__io_lookup_bool_option(halt_at_warn, HaltAtWarn,
-			State1, State9),
+			State1, State2),
 		Task1 = Task0,
 		(
 			(
@@ -177,9 +177,11 @@
 				HaltAtWarn = yes
 			)
 		->
+			io__set_exit_status(1, State2, State9),
 			module_info_incr_errors(ModuleInfo1, ModuleInfo8)
 		;
-			ModuleInfo8 = ModuleInfo1
+			ModuleInfo8 = ModuleInfo1,
+			State9 = State2
 		)
 	;
 		Task0 = update_module_cookie(Closure, Cookie0),
cvs diff: Diffing notes
-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list