This is the mail archive of the
mailing list for the GCC project.
Re: [debug-early] fix -fdump-go-spec
- From: Ian Lance Taylor <iant at golang dot org>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: jason merrill <jason at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 8 May 2015 11:06:04 -0700
- Subject: Re: [debug-early] fix -fdump-go-spec
- Authentication-results: sourceware.org; auth=none
- References: <55417DCC dot 2090708 at redhat dot com>
On Wed, Apr 29, 2015 at 5:56 PM, Aldy Hernandez <email@example.com> wrote:
> Despite what Go thinks:
> /* The debug hooks are used to implement -fdump-go-spec because it
> gives a simple and stable API for all the information we need to
> dump. */
> ...the debug hooks are not stable... :).
> With this patch I have done my best to give Go what it wants without
> recreating what the front-ends were doing. I've made the go_decl() call
> work from within the early_global_decl() hook which gets called as we parse
> (rest_of_decl_compilation). I far as I understand, this hack is a one-time
> thing for use internally in the build process, so we don't care whether
> go_decl() will receive location information??
That is true: the goal is to output the declarations in Go syntax;
location information is irrelevant.
> Is there not a more modern way of Go getting the DECLs it needs without
> abusing the debug_hook machinery?
I don't know.
Thanks for working on this. Have you tried building with
--enable-languages=go? On a GNU/Linux system it should build and pass
all tests with no extra effort.