[m-dev.] for review: use NULL for empty field types RTTI
Fergus Henderson
fjh at cs.mu.OZ.AU
Wed Nov 15 21:49:59 AEDT 2000
On 14-Nov-2000, Peter Ross <peter.ross at miscrit.be> wrote:
> On Tue, Nov 14, 2000 at 10:13:58PM +1100, Fergus Henderson wrote:
> > compiler/rtti_out.m:
> > compiler/rtti_to_mlds.m:
> > compiler/type_ctor_info.m:
> > When generating RTTI for constructors with no arguments, don't
> > generate empty `field_types' arrays; not all C compilers
> > support empty array initializers. Instead, if there are no
> > arguments, just use a null pointer.
> >
> > This is slightly more efficient than the previous approach to
> > this problem which was to generate an array containing a
> > single dummy element. With this approach, we generate a null
> > pointer rather than a pointer to an array containing a null pointer.
> >
> > The other advantage of this change is that it makes the
> > treatment of the `field_types' array consistent with how we
> > treat the `field_names' array.
>
> This change looks fine.
>
> Any plans to do it for the other two array types where I inserted dummy
> values?
Which other two array types? Do you mean field_names and exist_locns?
For both of those, we already do that. I'm just making what we do
for field_types consistent with them.
(The log message didn't mention the latter case.
I'll change the last line of the log message to
treat the `field_names' and `exist_locns' arrays.
^^^^^^^^^^^^^^^^^
to clarify this.)
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- 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