Skip to content

Split interfaces to the glue layer and backend into different files#5180

Merged
9rnsr merged 1 commit intodlang:masterfrom
yebblies:glueback
Oct 11, 2015
Merged

Split interfaces to the glue layer and backend into different files#5180
9rnsr merged 1 commit intodlang:masterfrom
yebblies:glueback

Conversation

@yebblies
Copy link
Contributor

@yebblies yebblies commented Oct 9, 2015

And add make rules to build a backendless dmd.

In order to generate header files for dmd, I need a working dmd binary with the c++ header generation enabled. Until the frontend headers are built it's impossible to build the dmd glue layer or backend.

So the steps are:

  • Build a frontend-only version of dmd with C++ header support
  • Generate the headers
  • Build the full version of dmd

This process will let us move to generated headers without changing build dependencies.

@yebblies yebblies added the DDMD label Oct 9, 2015
@yebblies
Copy link
Contributor Author

yebblies commented Oct 9, 2015

See also #5082

@ibuclaw
Copy link
Member

ibuclaw commented Oct 10, 2015

I would prefer the idea of ddmd.backend to be a package containing what you've decided to call gluelayer, then have ddmd.backend.dmd as the place to keep your backend-proper.

@yebblies
Copy link
Contributor Author

What would that gain? I don't see the point.

I'm thinking about splitting out the 'driver' code (mars, lib_, scan_, inifile, link etc) from the rest of the frontend, and as you know I'd like to ban glue/backend references from the rest of the frontend.

@ibuclaw
Copy link
Member

ibuclaw commented Oct 10, 2015

Well, apart from gluelayer looking aesthetically unpleasing to my eyes... :-)

It could be at least be used as a connector for alternate backends, eg, ddmd.backend.gdc being where I put references to my functions, types, symbols, and so on...

As for the ban on references, I'm certainly not against the idea of using a common name/alias for backend types so long as they have a consistent naming scheme.
eg:

version (DM_Backend)
{
    alias Btype = TYPE;
    alias Bsymbol = Symbol
}
version (GCC_Backend)
{
    alias Btype = tree;
    alias Bsymbol = tree;
}

And so on...

@yebblies
Copy link
Contributor Author

Well, apart from gluelayer looking aesthetically unpleasing to my eyes... :-)

Think of it as temporary!

The problem with the current system of using type/Symbol/etc is that's it's not enough. Some backends need members in more ast classes, some need less... If we really want to have the frontend as a re-usable library, then we really should be removing the backend references IMO.

@9rnsr
Copy link
Contributor

9rnsr commented Oct 11, 2015

I can accept this temporary change, after the Darwin_64_32 breaking is fixed.

@yebblies yebblies force-pushed the glueback branch 4 times, most recently from 296ac1e to be9c324 Compare October 11, 2015 13:00
@yebblies
Copy link
Contributor Author

@9rnsr Updated.

@9rnsr
Copy link
Contributor

9rnsr commented Oct 11, 2015

Auto-merge toggled on

9rnsr added a commit that referenced this pull request Oct 11, 2015
Split interfaces to the glue layer and backend into different files
@9rnsr 9rnsr merged commit 65b079f into dlang:master Oct 11, 2015
@yebblies
Copy link
Contributor Author

Thanks!

@yebblies yebblies deleted the glueback branch October 11, 2015 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants