Quoting Nathan Froyd <froy...@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.
But at any rate, the member function implementations would not be part
of the globally-visible target vector.  They are in a smaller vector, and
only the pieces of the middle end that deal with argument passing get to
see them.
Does that mean you acknowledge that we shouldn't have CUMULATIVE_ARGS
taking hooks in the global target vector?

Reply via email to