[m-dev.] for review: use NULL for empty field types RTTI

Peter Ross peter.ross at miscrit.be
Thu Nov 16 22:18:38 AEDT 2000


On Wed, Nov 15, 2000 at 09:49:59PM +1100, Fergus Henderson wrote:
> 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.)
> 
Yes, they are the two I meant.

I just had a look at the code in rtti_out.m and the hacks are still
there.  I guess that they are only now needed for the LLDS backend.

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