Target macros vs. target hooks - policy/goal is hooks, isn't it?

Ulrich Weigand
Wed May 26 17:16:00 GMT 2010

Steven Bosscher wrote:

> So the question is: The goal is to have hooks, not macros, right? If
> so, can reviewers please take care to reject patches that introduce
> new macros?

I don't know to which extent this is a formal goal these days, but I
personally agree that it would be nice to eliminate macros.

However, there are (or at least, used to be) some areas where using
hooks is a bit difficult, in particular where interactions between
the back-end and one particular front-end (as opposed to common code)
are concerned.  This is the reason why we implemented 
TARGET_ADDR_SPACE_KEYWORDS as macro (note that all the other
address-space related back-end callbacks were already implemented
as hooks to begin with).

> Kai already said on IRC last night that he can hookize
> TARGET_ENUM_VA_LIST. Could the folks who introduced
> TARGET_ADDR_SPACE_KEYWORDS please do the same?

I'll have a look.  What is the preferred solution these days for
hooks between the C front-end and a back-end?  targetcm?
(Why is there both targetcm and targetm.c ?)


  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE

More information about the Gcc mailing list