On Sat, 16 Nov 2013, Chung-Lin Tang wrote: > >> +/* Local prototypes. */ > > > > I'd much prefer not to have any of those. Achieve this by putting > >> +struct gcc_target targetm = TARGET_INITIALIZER; > > along with all the necessary definitions at the end of the file (and > > reordering some other functions). > > I would rather keep it that way. The ARM backend is another example of this.
I agree with Bernd's preference of topologically sorting static functions / variables so forward declarations are only needed in cases of recursion. I sometimes think it should be possible to convert many target macros to hooks, including generating function definitions from the macro definitions in .h files, with a lot more automation than I think has been used for that before. Some back ends using a style rather requires forward function declarations is a needless complication for that sort of thing (indeed, if anyone were working on automated target macro to hook conversion, I'd suggest an early automated change should be making all back ends define targetm at the end of the file and avoid forward static declarations where possible). -- Joseph S. Myers jos...@codesourcery.com