[m-rev.] for review: renaming head variables fix

Julien Fischer juliensf at csse.unimelb.edu.au
Thu May 17 12:39:40 AEST 2007


On Wed, 16 May 2007, Zoltan Somogyi wrote:

> Fix the failure of the invalid/modes_erroneous test case, whose symptom was
> an error message about a "mode error in unification of `X' and `X'".
> The root cause of the problem was that the renaming of head variables
> computed by headvar_names.m was being applied too early, during typechecking.
> The fix is to apply it after the frontend (all the passes that can generate
> error messages).
>
> To avoid slowdowns from larger pred_infos, this diff also moves the least
> frequently used fields of pred_infos to a subterm. (Proc_infos already had
> a subterm.) This leads to an almost 3% speedup.
>
> compiler/headvar_names.m:
> 	Store the renaming instead of applying it.
>
> compiler/simplify.m:
> 	Apply the renaming in invocations after the front end, since doing so
> 	may allow some excess assignments to be eliminated.
>
> compiler/hlds_pred.m:
> 	Add fields to pred_infos and proc_infos for the renaming.
>
> 	Move the least frequently used fields of pred_infos into a
> 	pred_sub_info.
>
> 	Some fields of pred_infos were being accessed using predicates
> 	that did not follow our naming conventions, and some were accessed
> 	using field access functions that are now inappropriate; fix them all.
>
> 	Require the caller to provide the renaming when creating new pred_infos
> 	and proc_infos. This is to force the compiler components that do this
> 	to propagate the renaming fields of the original predicates and/or
> 	procedures to their modified versions.
>
> 	Convert that some old code that used if-then-elses to use switches
> 	instead.
>
> compiler/hlds_out.m:
> 	Write out the new pred_info and proc_info fields.
>
> compiler/*.m:
> 	Conform to the changes in hlds_pred.m.
>
> compiler/hlds_clauses.m:
> 	Avoid ambiguity by giving a prefix to the fields of the clauses_info
> 	type.
>
> tests/invalid/ho_type_mode_bug.err_exp:
> tests/invalid/merge_ground_any.err_exp:
> 	Don't expect error messages about a "X = X" anymore.

That's fine.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list