[m-dev.] for review: use NULL for empty field types RTTI
Peter Ross
peter.ross at miscrit.be
Tue Nov 14 22:47:33 AEDT 2000
On Tue, Nov 14, 2000 at 10:13:58PM +1100, Fergus Henderson wrote:
> Peter Ross, could you please review this one?
>
> Estimated hours taken: 1
>
> compiler/rtti.m:
> 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?
Pete
--------------------------------------------------------------------------
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