[m-dev.] for review: track module name for instance declarations
Tyson Dowd
trd at cs.mu.OZ.AU
Tue Oct 31 22:56:58 AEDT 2000
This change looks good, thanks Fergus.
On 31-Oct-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> For review by Tyson.
>
> Estimated hours taken: 6
>
> Record the module that each instance declaration came from.
> This is needed for the IL back-end, which includes that
> module name in the symbol name that it generates for each
> instance declaration.
>
> compiler/prog_data.m:
> Add a module_name field to the `instance' item.
>
> compiler/prog_io_typeclass.m:
> When parsing `instance' declarations, store the
> module name that they came from in the module_name field
> of the `instance' item.
>
> compiler/hlds_data.m:
> Add a module_name field to the `hlds_instance_defn' structure.
>
> compiler/make_hlds.m:
> Copy the module_name field from the `instance' item to the
> `hlds_instance_defn' structure.
>
> compiler/polymorphism.m:
> Fix an old XXX: when constructing `base_typeclass_info_const's,
> use the module name from the `hlds_instance_defn', rather than
> hard-coding the invalid value "some bogus module name".
>
> compiler/rtti.m:
> Add a module_name field to the `base_typeclass_info' rtti_name
> and rtti_data.
>
> compiler/base_typeclass_info.m:
> Copy the module_name field in the `hlds_instance_defn' to the
> module_name field in the `base_typeclass_info' rtti_data
> and rtti_name.
>
> compiler/rtti_to_mlds.m:
> When constructing mlds `data_addr's, use the module_name from
> the `base_typeclass_info' rtti_name, rather than assuming that
> such references always refer to instance declarations in the
> current module. (That assumption would be a safe one currently,
> but doing it this way is probably a bit more robust against
> future changes.)
>
> compiler/*.m:
> Trivial changes to reflect the above data structure changes.
>
--
Tyson Dowd #
# Surreal humour isn't everyone's cup of fur.
trd at cs.mu.oz.au #
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
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