This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: CUMULATIVE_ARGS in hooks (Was: RFC: semi-automatic hookization)


On Tue, Nov 16, 2010 at 10:22:00PM -0500, Joern Rennecke wrote:
> Quoting Nathan Froyd <froydnj@codesourcery.com>:
> >I am admittedly a C++ newbie; the first thing I thought of was:
> >
> >class gcc::cumulative_args {
> >  virtual void advance (...) = 0;
> >  virtual rtx arg (...) = 0;
> >  virtual rtx incoming_arg (...) { return this->arg (...); };
> >  virtual int arg_partial_bytes (...) = 0;
> >  // ...and so on for many of the hooks that take CUMULATIVE_ARGS *
> >  // possibly with default implementations instead of pure virtual
> >  // functions.
> >};
> 
> Trying to put a target-derived object of that into struct rtl_data would
> be nonsentical.  You might store a pointer, of course.

Yes, of course.  I thought that might have been clear from context.

> Does that mean you acknowledge that we shouldn't have CUMULATIVE_ARGS
> taking hooks in the global target vector?

Maybe?  I think the methods discussed in this thread would be better for
when we do move to C++.  I don't think your original proposal or
anything that sacrifices the type-safety of the current interface is the
way forward.

-Nathan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]