[m-rev.] for review: grade independent .mh files (bug #52)

Julien Fischer juliensf at csse.unimelb.edu.au
Thu Mar 27 15:29:08 AEDT 2008


On Thu, 27 Mar 2008, Julien Fischer wrote:

> For review by anyone.
>
> Estimated hours taken: 2
> Branches: main
>
> Make the .mh files grade independent again.  They were not grade independent
> because the types of the globals used to implement mutables can differ 
> between
> the high- and low-level C backends.  The fix is to output declarations for
> both backends in .mh files and select between them using #ifdef 
> MR_HIGHLEVEL_CODE.
>
> compiler/make_hlds_passes.m:
> 	Write out #ifdef protected declarations for the globals used to
> 	implement mutables that are appropriate for both C backends.
>
> 	Separate out the code for generating the mutable declarations and
> 	definitions.  While there is some common structure the above change
> 	makes it quite hard to follow if they are combined.  In this case
> 	separating them is the lesser of two evils.
>
> compiler/handle_options.m:
> 	Add a comment mentioning that if the value of the
> 	mutable_always_boxed option is changed then the code in
> 	make_hlds_passes that processes mutable declarations will need to be
> 	updated.

Incidentally, it isn't possible to provide a regression test here since
such a test would require the library to be installed in multiple
grades.

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