This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][1/3] Re-submission of Altera Nios II port, gcc parts
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Chung-Lin Tang <cltang at codesourcery dot com>
- Cc: Bernd Schmidt <bernds at codesourcery dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Sandra Loosemore <sandra at codesourcery dot com>, "Sidwell, Nathan" <Nathan_Sidwell at mentor dot com>, Richard Henderson <rth at redhat dot com>
- Date: Sat, 16 Nov 2013 12:39:39 +0000
- Subject: Re: [PATCH][1/3] Re-submission of Altera Nios II port, gcc parts
- Authentication-results: sourceware.org; auth=none
- References: <51E25932 dot 2060909 at codesourcery dot com> <525FF095 dot 5050207 at codesourcery dot com> <5287425C dot 6040207 at codesourcery dot com>
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
joseph@codesourcery.com