intermod.m bug fix

Simon TAYLOR stayl at cs.mu.oz.au
Fri May 23 19:12:06 AEST 1997


Estimated hours taken: 0.1

compiler/intermod.m
	Use the declared argmodes or procedures when gathering modes to put
	into .opt files, since these are the modes that are written to the
	.opt file.

tests/valid/intermod_lambda.m
tests/valid/intermod_lambda2.m
	Updated these to act as a regression test.



Index: intermod.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/intermod.m,v
retrieving revision 1.24
diff -u -r1.24 intermod.m
--- intermod.m	1997/05/05 11:17:07	1.24
+++ intermod.m	1997/05/23 07:47:01
@@ -598,7 +598,7 @@
 intermod__gather_pred_modes(ModuleInfo, Modes, Insts, Procs, [ProcId | ProcIds])
 		-->
 	{ map__lookup(Procs, ProcId, ProcInfo) }, 
-	{ proc_info_argmodes(ProcInfo, ArgModes) },
+	{ proc_info_declared_argmodes(ProcInfo, ArgModes) },
 	intermod__gather_proc_modes(ModuleInfo, Modes, Insts, ArgModes),
 	intermod__gather_pred_modes(ModuleInfo, Modes, Insts, Procs, ProcIds).
 


Index: intermod_lambda.m
===================================================================
RCS file: /home/staff/zs/imp/tests/valid/intermod_lambda.m,v
retrieving revision 1.1
diff -u -r1.1 intermod_lambda.m
--- intermod_lambda.m	1997/04/02 05:30:25	1.1
+++ intermod_lambda.m	1997/05/23 08:11:24
@@ -1,11 +1,13 @@
 % Regression test for resolving overloading of higher-order terms
 % exported using inter-module optimization.
+% This is also a regression test to check that local modes are put
+% in the .opt files.
 :- module intermod_lambda.
 
 :- interface.
 
 :- type foo.	% not used
 
-:- import_module intermod_lambda2.
+:- implementation.
 
-:- interface.
+:- import_module intermod_lambda2.
Index: intermod_lambda2.m
===================================================================
RCS file: /home/staff/zs/imp/tests/valid/intermod_lambda2.m,v
retrieving revision 1.1
diff -u -r1.1 intermod_lambda2.m
--- intermod_lambda2.m	1997/04/02 05:30:26	1.1
+++ intermod_lambda2.m	1997/05/23 08:11:35
@@ -1,10 +1,12 @@
 % Regression test for higher-order terms exported using 
 % inter-module optimization.
+% This is also a regression test to check that local modes are put
+% in the .opt files.
 :- module intermod_lambda2.
 
 :- interface.
 
-:- import_module list, set.
+:- import_module list.
 
 %-----------------------------------------------------------------------------%
 
@@ -14,14 +16,19 @@
 
 :- implementation.
 
+:- mode in2 :: in.
+
 sol(Generator, List) :-
-	t(Generator, cons, [], List).
+	Cons = lambda([Elem::in, L0::in, L::out] is det, (
+			cons(Elem, L0, L)
+		)),
+	t(Generator, Cons, [], List).
 
 :- pred cons(T::in, list(T)::in, list(T)::out) is det.
 cons(H, T, [H|T]).
 
 :- pred t(pred(T), pred(T,T2,T2), T2, T2).
-:- mode t(pred(out) is det, pred(in,in,out) is det, in, out) is det.
+:- mode t(pred(out) is det, pred(in,in,out) is det, in2, out) is det.
 
 t(_, _, A, A).
 



More information about the developers mailing list