[m-rev.] Trivial diff: fix repeated state variable errors bug

Ralph Becket rafe at cs.mu.OZ.AU
Thu Oct 7 17:13:24 AEST 2004


Estimated hours taken: 2
Branches: main

Fix repeated state-variable error reports.

compiler/make_hlds.m:
	If colon/9 detects a state-variable error, set up a dummy mapping
	for the state variable to prevent the same error being reported twice.

Index: compiler/Mercury.options
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Mercury.options,v
retrieving revision 1.7
diff -u -r1.7 Mercury.options
--- compiler/Mercury.options	12 Jan 2004 04:42:46 -0000	1.7
+++ compiler/Mercury.options	7 Oct 2004 05:35:58 -0000
@@ -6,6 +6,8 @@
 # Mercury.options - module-specific flags for Mmake and `mmc --make'.
 #-----------------------------------------------------------------------------#
 
+MCFLAGS-hlds.make_hlds = --trace deep
+
 # Compilation of rl_code.c is really slow, especially with --trace deep,
 # at the default level of -O2, due to the C optimizer's use of quadratic
 # algorithms on a couple of 20,000-line functions (the automatically
Index: compiler/make_hlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/make_hlds.m,v
retrieving revision 1.480
diff -u -r1.480 make_hlds.m
--- compiler/make_hlds.m	10 Sep 2004 03:36:12 -0000	1.480
+++ compiler/make_hlds.m	7 Oct 2004 07:07:19 -0000
@@ -9481,6 +9481,9 @@
 			!:SInfo = !.SInfo `with_updated_svar` StateVar
 		;
 		  	Var = StateVar,
+			% Set up a dummy mapping: there's no point
+			% in mentioning this error twice.
+			!:SInfo = ( !.SInfo ^ colon ^ elem(StateVar) := Var ),
 			( !.SInfo ^ external_dot `contains` StateVar ->
 				PError = report_illegal_state_var_update
 			;
--------------------------------------------------------------------------
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