[GSoC] Header Generation for C/C++

Iain Buclaw ibuclaw at gdcproject.org
Wed Jul 17 13:35:35 UTC 2019


On Wed, 17 Jul 2019 at 15:25, Eduard Staniloiu via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Wednesday, 17 July 2019 at 12:40:38 UTC, Iain Buclaw wrote:
> > On Tue, 16 Jul 2019 at 15:20, Eduard Staniloiu via
> > Digitalmars-d <digitalmars-d at puremagic.com> wrote:
> >> [...]
> >
> > So it's probably worth giving the generated header a test
> > against gdc then.
> >
> > https://github.com/gcc-mirror/gcc/tree/ibuclaw/gdc
> >
>
> I'll give this a shot. Could you please give me a helping hand on
> how to get gdc to compile with the generated `frontend.h`?
>

Should be straightforward, all front-end includes have the explicit path, e.g:

#include "dmd/aggregate.h"

Just replace them with:

#include "dmd/frontend.h"

And see if it fails to compile or bootstrap. :-)

> >
> >> [...]
> >
> > So this would be part of the compiler rather than a standalone
> > application?  What's the rationale there?
>
> Keeping it as part of the compiler doesn't require to redo all
> steps that `mars.d` does and it is also consistent with the
> current `.di` and `.json` generators.
>

But apart from the construction (and possible destruction) of all
frontend types, there shouldn't be anything duplicated.

Did you consider cross compiler generation?

-- 
Iain


More information about the Digitalmars-d mailing list