[m-dev.] for review: RTTI version numbers.
Tyson Dowd
trd at cs.mu.OZ.AU
Wed Oct 20 16:41:17 AEST 1999
On 19-Oct-1999, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
>
> > + % runtime/mercury_type_info.h. This means you need to update
> > + % the handwritten type_ctor_info structures and the code in the
> > + % runtime that uses RTTI to conform to whatever changes the new
> > + % version introduces.
>
> There is such code in the library as well.
>
> In fact, it would be a good idea if we had a central list of the source files
> that depend on the details of the RTTI system. The logical place to put this
> list would be in runtime/mercury_type_info.h.
Done.
Index: mercury_type_info.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_type_info.h,v
retrieving revision 1.28
diff -u -r1.28 mercury_type_info.h
--- mercury_type_info.h 1999/10/10 02:35:17 1.28
+++ mercury_type_info.h 1999/10/20 06:35:48
@@ -8,10 +8,25 @@
** mercury_type_info.h -
** Definitions for accessing the type_infos, type_layouts, and
** type_functors tables generated by the Mercury compiler.
-** Also contains definitions for accessing the Mercury `univ' type
-** and the Mercury `array' type.
-** Changes here may also require changes in compiler/polymorphism.m,
-** compiler/higher_order.m and library/private_builtin.m.
+** Also contains definitions for accessing the Mercury `univ' type.
+**
+** Changes here may also require changes in:
+**
+** compiler/base_type_info.m
+** compiler/base_type_layout.m
+** compiler/polymorphism.m
+** compiler/higher_order.m
+** (for updating the compiler-generated RTTI
+** structures)
+**
+** library/array.m
+** library/builtin.m
+** library/private_builtin.m
+** library/std_util.m
+** runtime/mercury_bootstrap.c
+** runtime/mercury_type_info.c
+** (for updating the hand-written RTTI
+** structures)
*/
#ifndef MERCURY_TYPE_INFO_H
>
> > --- builtin.m 1999/10/13 07:01:28 1.22
> > +++ builtin.m 1999/10/18 08:17:33
>
> This is why the central list would help: I think you missed library/array.m.
>
> I think it would a good idea if all the types basic to the Mercury system
> had their type_ctor_infos in one place (this does not include the
> type_ctor_infos array.m or std_util.m). At present they are scattered in
> several modules, in both the library and the runtime. That can be another
> change, though.
>
> > +#define MR_RTTI_VERSION MR_RTTI_VERSION__INITIAL
> > +#define MR_RTTI_VERSION__INITIAL 2
>
> What is the purpose of the __INITIAL macro? Does anything refer to it
> other than MR_RTTI_VERSION? If not, it should be deleted.
I intend it to be used as the symbolic name of the initial version,
rather than using magic numbers.
That way you can use MR_RTTI_VERSION__INITIAL to refer to version 2.
To add a new version just add
#define MR_RTTI_VERSION__MYFABULOUSCHANGE 3
When you no longer want to support version 2 you can delete this macro
and a recompile will ensure you haven't left MR_RTTI_VERSION__INITIAL
lying around anywhere.
>
> > MR_TypeCtorLayout type_ctor_layout;
> > String type_ctor_module_name;
> > String type_ctor_name;
> > + Integer version;
> > };
>
> The field name should be type_ctor_version.
Done.
--
Tyson Dowd #
# Surreal humour isn't eveyone'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