[m-rev.] diff: avoid line numbers in .opt files

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Aug 8 05:11:22 AEST 2001


I noticed the other day that I added something innocuous like a comment
to the implementation section of one of the library modules, and Mmake
proceeded to recompile everything in the library directory, because the
`.opt' file had changed.  The problem is that the `.opt' files included
comments saying what line number in the source things came from.

This bug seems to have been introduced back in mid-1999 when we made
the --line-numbers option enabled by default:

 | 	cvs log -r1.257 options.m
 | 	date: 1999/04/16 04:34:20;  author: zs;  state: Exp;  lines: +6 -5
 | 	[...]
 | 	compiler/option.m:
 | 		Make --line-numbers the default [...]

The following diff fixes the problem.

----------

Estimated hours taken: 1
Branches: main

compiler/handle_options.m:
	Don't include line numbers when making .opt files, because that
	causes spurious recompilations when the line numbers change.
	Likewise for .int, etc.

Workspace: /home/venus/fjh/ws-venus4/mercury
Index: compiler/handle_options.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/handle_options.m,v
retrieving revision 1.114
diff -u -d -r1.114 handle_options.m
--- compiler/handle_options.m	2 Aug 2001 19:50:35 -0000	1.114
+++ compiler/handle_options.m	7 Aug 2001 19:09:17 -0000
@@ -388,6 +388,15 @@
 	option_implies(errorcheck_only, smart_recompilation, bool(no)),
 	option_implies(typecheck_only, smart_recompilation, bool(no)),
 
+	% disable --line-numbers when building the `.int', `.opt', etc. files,
+	% since including line numbers in those would cause unnecessary
+	% recompilation
+	option_implies(make_private_interface,		line_numbers, bool(no)),
+	option_implies(make_interface,			line_numbers, bool(no)),
+	option_implies(make_short_interface,		line_numbers, bool(no)),
+	option_implies(make_optimization_interface,	line_numbers, bool(no)),
+	option_implies(make_transitive_opt_interface,	line_numbers, bool(no)),
+
 	% `--aditi-only' is only used by the Aditi query shell,
 	% for queries which should only be compiled once.
 	% recompilation_check.m currently doesn't check whether
-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list