CUMULATIVE_ARGS in hooks (Was: RFC: semi-automatic hookization)
Ian Lance Taylor
iant@google.com
Wed Nov 17 03:45:00 GMT 2010
Joern Rennecke <amylaar@spamcop.net> writes:
> I don't see how going to a struct cumulative_args gets us closer to
> a viable solution for a multi-target executable, even if you threw in
> C++. Having the target describe a type, and shoe-horning this through
> a target
> hook interface that is decribed in supposedly target-independent terms
> will require a cast at some point - either of the hook argument that
> describes the cumulative args, the hook pointer (not valid C / C++), or
> a pointer to the target vector, or a pointer to some factored-out part of
> the target vector. Converting an empty base class to a derived class
> is not really safer than converting a void * to a struct pointer.
> And switching to a dynamically typed language is not really on the
> agenda...
In C++ we would use a pure abstract base class in the target hooks and
the targets would have to provide an implementation for the base class.
Ian
More information about the Gcc
mailing list