for review: merge main branch changes into alias branch

David Overton dmo at cs.mu.OZ.AU
Mon Nov 23 12:00:21 AEDT 1998


Hi Fergus,

Could you please check the diff below.


David

Estimated hours taken: 1

Merge main branches changes up to tag `version-0_8' into the alias
branch.

Other changes required to get this to compile:

compiler/simplify.m:
	Pass an extra pair of args to modecheck_queued_procs for the
	old pred table.

compiler/polymorphism.m:
	Comment out the check for fully input polymorphic unifications
	because we don't pass an instmap around in polymorphism.  The
	case of partially instantiated polymorphic unifications should
	be caught earler, probably during mode analysis.  Note that
	this change causes `tests/invalid/polymorphic_unification' to
	fail.

Index: simplify.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/simplify.m,v
retrieving revision 1.46.2.18
diff -u -r1.46.2.18 simplify.m
--- 1.46.2.18	1998/11/10 07:13:31
+++ simplify.m	1998/11/22 23:45:16
@@ -174,8 +174,10 @@
 	proc_info_set_inst_table(ProcInfo3, InstTable, ProcInfo),
 
 	simplify_info_get_module_info(Info, ModuleInfo1),
+	module_info_preds(ModuleInfo1, OldPredTable0),
 	modecheck_queued_procs(check_unique_modes(may_change_called_proc),
-		ModuleInfo1, ModuleInfo, _Changed, State1, State),
+		OldPredTable0, ModuleInfo1, _OldPredTable, ModuleInfo,
+		_Changed, State1, State),
 
 	simplify_info_get_msgs(Info, Msgs).
 
Index: polymorphism.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/polymorphism.m,v
retrieving revision 1.117.2.24
diff -u -r1.117.2.24 polymorphism.m
--- 1.117.2.24	1998/11/10 07:13:22
+++ polymorphism.m	1998/11/23 00:03:07
@@ -978,10 +978,18 @@
 			;
 				error("polymorphism.m: can't find `builtin:unify/2'")
 			},
-			% XXX Bug! - we should check that the mode is (in, in),
-			%     and report an error (e.g. "unification of
-			%     polymorphically typed variables in partially
-			%     instantiated mode") if it isn't
+%		YYY we don't have an instmap here.  
+%		Polymorphic unification should be caught earlier 
+%		(e.g. in mode analysis).
+%		`tests/invalid/polymorphic_unification' will fail until this
+%		error is caught properly.
+%			{ Mode = XMode - YMode },
+%			{ require(mode_is_fully_input(InstMap, InstTable,
+%				ModuleInfo, XMode),
+%				"Sorry, not implemented: polymorphic unification in mode other than (in, in)") },
+%			{ require(mode_is_fully_input(InstMap, InstTable,
+%				ModuleInfo, YMode),
+%				"Sorry, not implemented: polymorphic unification in mode other than (in, in)") },
 			{ hlds_pred__in_in_unification_proc_id(ProcId) },
 			{ map__lookup(TypeInfoMap, TypeVar, TypeInfoLocn) },
 			{ SymName = unqualified("unify") },
-- 
David Overton           Department of Computer Science & Software Engineering
MEngSc Student          The University of Melbourne, Australia
+61 3 9344 9159         http://www.cs.mu.oz.au/~dmo



More information about the developers mailing list