[m-dev.] for review: frameopt bug fix

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Nov 12 01:32:30 AEDT 1999


On 11-Nov-1999, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> 
> compiler/frameopt.m:
> 	Perform substitutions on pragma C code labels that occur only in
> 	in pragma_c_fail_to components.

The word "in" is duplicated.

llds_out.m:
> +output_pragma_c_component(pragma_c_fail_to(Label)) -->
> +	io__write_string("if (!r1) GOTO_LABEL("),

That will add more work for when we add MR_ prefixes to those, <sigh>.
But commit it as is.  The MR_ prefixes can wait for another change.

opt_util.m:
> +	% Replace references to one set of labels with references
> +	% to another set, in one instruction or a list of instructions.
> +	% Control references are always replaced; references that treat the
> +	% label as data are replaced iff the third argument is set to "yes".
> +:- pred opt_util__replace_labels_instr(instr::in, map(label, label)::in,
> +	bool::in, instr::out) is det.

I think it would be a good idea to elaborate a bit more on the
difference between "control" references and "data" references.

> +opt_util__replace_labels_instr(label(Label), ReplMap, _, label(Label)) :-
> +	( map__search(ReplMap, Label, _) ->
> +		error("eliminated label in opt_util__replace_labels_instr")
> +	;
> +		true
> +	).

It might be a good idea to add a comment here.

Apart from that, that change looks good.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list