New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Break dependency of expression.d on gluelayer.d #15786
Conversation
Thanks for your pull request and interest in making D better, @RazvanN7! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#15786" |
Long term I want to to get rid of storing backend symbols inside frontend classes altogether |
We tried internal AA for each kind of backend symbol, but that was denied for being too slow (without benchmarking, but I think it is a given that anything is slower than direct pointer access). |
@@ -2373,7 +2372,7 @@ extern (C++) final class StructLiteralExp : Expression | |||
// while `sym` is only used in `e2ir/s2ir/tocsym` which comes after | |||
union | |||
{ | |||
Symbol* sym; /// back end symbol to initialize with literal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is incomplete. There's also typedefs to deal with.
Regardless, I don't think this is as small a change for C++ codebases as it is for D. So hold fire.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought Symbol
was dmd-only, so it wouldn't affect other compilers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Symbol seems to be an alias to a tree_node in gcc. I am expecting that all you need to do on the GCC side is to replace all occurences of sym
to (tree_node*)sym
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dkorpel the gluelayer has a version(IN_GCC) that alias Symbol to an extern gcc symbol (tree_node). Still, I don't see how this makes things complicated for gdc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regardless, I don't think this is as small a change for C++ codebases as it is for D. So hold fire.
I highly doubt it. At most it requires the insertion of a couple of pointer casts.
LDC #if
s out the use of Symbol
in module.h
so the typedefs are a non-issue for us. Indeed dmd.gluelayer
does not define Symbol
with version (IN_LLVM)
, at all. The usage here is void*
in D and llvm::Type*
in the header file.
It has all of 4 uses which would add 4 pointer casts.
Also this PR affects only StructLiteralExp
it doesn't touch any other uses of Symbol
@thewilsonator don't auto-merge after 15 minutes of the PR being open please. Not everyone affected is in the same timezone, and can respond in short notice. :-) |
Agreed, however, apart from AAs, I don't really have an idea on how to do that. |
There's the (possibly ill-defined)
but that just changes the names from one thing to another. |
@ibuclaw how do we move forward from here? This is the last of expression.d's unwanted dependency. |
@RazvanN7 please rebase |
1b9fb4d
to
aa632ee
Compare
Not a disruptive change to C++ users, only requires a few pointer casts.
Reverting because we agreed the proper way last DLF meeting. |
... which is? |
You would already know if you didn't dismiss and merge PRs within 5 minutes. Ask next time please. |
No description provided.