diff - mode error messages

Simon TAYLOR stayl at students.cs.mu.oz.au
Tue Feb 18 15:32:48 AEDT 1997


Hi Fergus,

This diff cleans up the error messages now that propagate_type_info_into_modes
is enabled.


Estimated hours taken: 0.1

compiler/mode_util.m
	Stop $typed_inst and $typed_ground appearing in error messages.


Index: mode_util.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/mode_util.m,v
retrieving revision 1.80
diff -u -r1.80 mode_util.m
--- mode_util.m	1997/02/17 01:26:48	1.80
+++ mode_util.m	1997/02/18 04:03:30
@@ -1784,8 +1784,9 @@
 strip_builtin_qualifiers_from_inst(bound(Uniq, BoundInsts0),
 					bound(Uniq, BoundInsts)) :-
 	strip_builtin_qualifiers_from_bound_inst_list(BoundInsts0, BoundInsts).
-strip_builtin_qualifiers_from_inst(defined_inst(Name0), defined_inst(Name)) :-
-	strip_builtin_qualifiers_from_inst_name(Name0, Name).
+strip_builtin_qualifiers_from_inst(defined_inst(Name0), Inst) :-
+	strip_builtin_qualifiers_from_inst_name(Name0,
+		defined_inst(Name0), Inst).
 strip_builtin_qualifiers_from_inst(abstract_inst(Name0, Args0),
 				abstract_inst(Name, Args)) :-
 	strip_builtin_qualifier_from_sym_name(Name0, Name),
@@ -1804,16 +1805,23 @@
 	BoundInst = functor(ConsId, Insts),
 	list__map(strip_builtin_qualifiers_from_inst, Insts0, Insts).
 
-:- pred strip_builtin_qualifiers_from_inst_name(inst_name::in, inst_name::out)
-	is det.
-strip_builtin_qualifiers_from_inst_name(InstName0, InstName) :-
+:- pred strip_builtin_qualifiers_from_inst_name(inst_name::in, (inst)::in,
+		(inst)::out) is det.
+
+strip_builtin_qualifiers_from_inst_name(InstName0, Inst0, Inst) :-
 	( InstName0 = user_inst(SymName0, Insts0) ->
 		strip_builtin_qualifier_from_sym_name(SymName0, SymName),
 		strip_builtin_qualifiers_from_inst_list(Insts0, Insts),
-		InstName = user_inst(SymName, Insts)
+		Inst = defined_inst(user_inst(SymName, Insts))
+	; InstName0 = typed_inst(_, InstName1) ->
+		% Don't output the $typed_inst in error messages.
+		strip_builtin_qualifiers_from_inst_name(InstName1, Inst0, Inst)
+	; InstName0 = typed_ground(Uniq, _Type) ->
+		% Don't output the $typed_ground in error messages.
+		Inst = ground(Uniq, no)
 	;
 		% for the compiler-generated insts, don't bother.
-		InstName = InstName0
+		Inst = Inst0
 	).
 
 :- pred strip_builtin_qualifiers_from_pred_inst(maybe(pred_inst_info)::in,



More information about the developers mailing list