trivial diff: bugfix in termination.m

Christopher Rodd SPEIRS crs at students.cs.mu.oz.au
Thu Oct 16 00:55:17 AEST 1997


Estimated hours taken: 0.5

Fixed a bug in termination.m.  When writing intermodule optimization
information, place it into <module>.opt.tmp.  It used to be placed into
<module>.opt which was then overwritten by update_interface.  This
change also fixes another bug.  If the compiler was run with the -v
option, the "% Checking termination ..." message was printed out twice,
once in mercury_compile.m, and once in termination.m. 

compiler/termination.m:
	When writing intermodule optimization information, write it into
	<module>.opt.tmp instead of <modul>.opt.  Also move some verbose
	progress messages into mercury_compile.m.

compiler/mercury_compile.m:
	All the verbose progress messages for termination analysis are
	now in mercury_compile.m.

Index: mercury_compile.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.58
diff -u -r1.58 mercury_compile.m
--- 1.58	1997/10/13 08:09:48
+++ mercury_compile.m	1997/10/15 05:32:59
@@ -978,6 +978,7 @@
 	->
 		maybe_write_string(Verbose, "% Detecting termination...\n"),
 		termination__pass(HLDS0, HLDS),
+		maybe_write_string(Verbose, "% Termination checking done.\n"),
 		maybe_report_stats(Stats)
 	;
 		{ HLDS = HLDS0 }
Index: termination.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/termination.m,v
retrieving revision 1.3
diff -u -r1.3 termination.m
--- 1.3	1997/10/14 18:06:56
+++ termination.m	1997/10/15 06:43:45
@@ -90,9 +90,7 @@
 %-----------------------------------------------------------------------------%
 
 termination__pass(Module0, Module) -->
-	globals__io_lookup_bool_option(verbose, Verbose),
 	globals__io_get_termination_norm(TermNorm),
-	maybe_write_string(Verbose, "% Checking termination...\n"),
 	{ module_info_ensure_dependency_info(Module0, Module1) },
 	{ module_info_predids(Module1, PredIds) },
 
@@ -112,10 +110,7 @@
 		termination__make_opt_int(PredIds, Module)
 	;
 		[]
-	),
-
-	maybe_write_string(Verbose, "% Termination checking done.\n").
-
+	).
 
 % This predicate sets the functor info depending on the value of the
 % termination_norm option. The functor info field stores the weight which
@@ -526,7 +521,7 @@
 :- mode termination__make_opt_int(in, in, di, uo) is det.
 termination__make_opt_int(PredIds, Module) -->
 	{ module_info_name(Module, ModuleName) },
-	{ string__append(ModuleName, ".opt", OptFileName) },
+	{ string__append(ModuleName, ".opt.tmp", OptFileName) },
 	io__open_append(OptFileName, OptFileRes),
 	( { OptFileRes = ok(OptFile) } ->
 		io__set_output_stream(OptFile, OldStream),



More information about the developers mailing list