On Thu, 2013-08-01 at 11:28 -1000, Richard Henderson wrote:
> On 07/26/2013 05:04 AM, David Malcolm wrote:
> > +/* Functions relating to the garbage collector.  */
> > +void
> > +gcc::context::gt_ggc_mx ()
> > +{
> > +  /* Currently a no-op.  */
> > +}
> > +
> > +void
> > +gcc::context::gt_pch_nx ()
> > +{
> > +  /* Currently a no-op.  */
> > +}
> > +
> > +void
> > +gcc::context::gt_pch_nx (gt_pointer_operator op ATTRIBUTE_UNUSED,
> > +                    void *cookie ATTRIBUTE_UNUSED)
> > +{
> > +  /* Currently a no-op.  */
> > +}
> 
> I suppose these are members because you'll want to access private members
> later, and that's easier than playing with "friend"?

Exactly.  The patch adds a comment about this to gcc/context.h.

> > +void gt_ggc_mx (gcc::context *ctxt)
> > +{
> > +  ctxt->gt_ggc_mx ();
> > +}
> > +
> > +void gt_pch_nx (gcc::context *ctxt)
> > +{
> > +  ctxt->gt_pch_nx ();
> > +}
> > +
> > +void gt_pch_nx (gcc::context *ctxt, gt_pointer_operator op, void *cookie)
> > +{
> > +  ctxt->gt_pch_nx (op, cookie);
> > +}
> 
> Should these be inline functions in context.h, so that the call does direct?
> Or do we take their address, making that sorta pointless?
> 
> It seems like there's one level of indirection here that is avoidable...

It looks like they can be inlined - their addresses are not taken, and
they're only used by gtype-desc.c, inside the autogenerated functions
gt_ggc_mx_context, gt_pch_nx_context, and gt_pch_p_7context.

I'll make them inline in context.h

Reply via email to