Can help with task of language frontend cleanup

Jonathan Wakely
Thu Mar 25 12:06:08 GMT 2021

On Thu, 25 Mar 2021 at 09:43, pawel k. via Gcc-help
<> wrote:
> Hello,
> Not sure which list is right. I have ideas for code improvement for gcc.

Please don't cross-post to gcc@ and gcc-help@, there are almost no
topics relevant to both. You're discussing GCC development, so gcc@ is
the right place.

> Idea1 langhooks cleanup
> It basically involves clean up of lang hooks. Closing it in special class.
> Might help to clean up massive defines etc spurious langhooks declarations
> amongst others and removing some hooks from hooks.h/c and langhooks.h/c.
> Also in this solution wed gain some cputime by not calling langhooks via
> func pointers.
> Idea 1a multiple langhooks in single binary. Choosable in runtime.
> Ideally will allow compiling in multiple frontends in single binary and
> choosing in runtime which lang front to use.

What would be the benefit?

I can understand the advantage of a single binary that is a
cross-compiler for different targets (but it would be a huge task to
get GCC there). You wouldn't need multiple complete copies of GCC
installed to do cross-compilation if there was a --target option like
Clang's. But what's the benefit to users of a single binary for
different languages? The 'gcc' driver already exists and gives that
functionality, what would change with your proposal?

> It doesnt seem very difficult just quite laborious. If anyone is interested
> in such improvement please authorize me to branch off.

I'm not sure what you mean by this, but you can just create a clone of
the Git repo and host it anywhere you want.

More information about the Gcc mailing list