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: RFC: target macro->hook migration idea


On Tue, 22 Jul 2003, DJ Delorie wrote:

> I wasn't planning on changing the interface, beyond a few hooks that
> I'd like to add extra parameters to.  I was going to mechanically
> convert the macros to functions, keeping the same names, args, and
> return types.

In general the argument types of the macros have not been defined (and
this has caused format warning problems in the past).  For every new
function, the correct argument types need to be worked out (and
documented).

The macros specified to goto a label outside the macro (a problem
discussed in projects/beginner.html) need redefining.

Some methodology needs working out for what should be a macro and what
should be a function.  I presume that e.g. the basic macros for type sizes
(that generally expand to integer constants) aren't intended to move to
the structure.

The mess of default macro definitions not all being in defaults.h needs
sorting out, if the default function definitions are to go in one place.  
The mess of target macros being used in definitions of other target macros
(where replacement by a call to the function may not always be
appropriate) needs sorting out.  Default (or other) definitions of a macro
duplicated in many targets need sorting out (with a per-port conversion
this duplication is less visible than with a per-macro conversion), and
the definitions in common files such as elfos.h probably need to be
converted to single central functions, documented as available for ports
wanting a particular behaviour.

I presume the intention is to convert only documented target macros (to
documented target functions, with documented helper functions available
where some non-default definition is used by more than one port)?  Bug
3386 has a description of various checks for undocumented / unused /
undefined / ... target macros that could do with being done on an
up-to-date tree; general conversion to functions might show up more
clearly what macros are nowhere used, and what macros are defined but not
documented, but not cases where e.g. only one definition is used.

-- 
Joseph S. Myers
jsm@polyomino.org.uk


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