[m-rev.] for review: fix mode-specific clauses bug

Tyson Dowd trd at cs.mu.OZ.AU
Fri Aug 17 19:16:14 AEST 2001


On 17-Aug-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> 
> Estimated hours taken: 0.5
> Branches: main
> 
> compiler/hlds_out.m:
> 	When writing a mode-specific clause in a `.opt' file, get the modes
> 	of the procedure using proc_info_declared_argmodes rather than
> 	proc_info_argmodes. This is necessary because the test in
> 	make_hlds.m to work out whether a clause matches a mode declaration
> 	uses syntactic equality on the modes, but the modes returned by
> 	proc_info_argmodes may have been expanded by
> 	propagate_types_into_modes.
> 
> compiler/intermod.m:
> 	Tell hlds_out.m to use the declared modes when writing clauses.
> 
> tests/hard_coded/multimode.m:
> tests/hard_coded/multimode_main.exp:
> 	Test case.

> Index: compiler/intermod.m
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/compiler/intermod.m,v
> retrieving revision 1.106
> diff -u -u -r1.106 intermod.m
> --- compiler/intermod.m	2001/08/12 08:13:09	1.106
> +++ compiler/intermod.m	2001/08/17 05:12:38
> @@ -1437,8 +1437,11 @@
>  	% where the added arguments for a DCG pred expression
>  	% are named the same as variables in the enclosing clause.
>  	{ AppendVarNums = yes },
> +	{ ForIntermod = yes },
> +	{ MaybeVarTypes = no },
>  	hlds_out__write_clause(1, ModuleInfo, PredId, VarSet, AppendVarNums,
> -		ClauseHeadVars, PredOrFunc, Clause, no).
> +		ClauseHeadVars, PredOrFunc, Clause, ForIntermod,
> +		MaybeVarTypes).
>  
>  intermod__write_clause(ModuleInfo, PredId, VarSet, _HeadVars,
>  		PredOrFunc, SymName, Clause) -->

I think the variable name "ForIntermod" is confusing, as
hlds_out__write_clause refers to this as "UseDeclaredModes".  It's
conceivable that in future this might cause confusion. 

Otherwise this change looks fine, and thanks very much for fixing it!

Tyson.
--------------------------------------------------------------------------
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