Refactor: Extract combine and extractLast from Expression AST node to semantic layer#22618
Refactor: Extract combine and extractLast from Expression AST node to semantic layer#22618Adityazzzzz wants to merge 5 commits intodlang:masterfrom
Conversation
As part of the 'Separate Semantic Routines' project, this extracts the AST-mutating static methods `combine` and `extractLast` from the `Expression` class in `expression.d` and moves them to `expressionsem.d` as free functions. Also adds the appropriate D-to-C++ wrappers in `cxxfrontend.d` under the dmd namespace to maintain compatibility for GDC/LDC consumers.
|
Thanks for your pull request and interest in making D better, @Adityazzzzz! 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#22618" |
compiler/src/dmd/cxxfrontend.d
Outdated
| * expressionsem.d | ||
| */ | ||
|
|
||
| Expression combine(Expression e1, Expression e2) |
There was a problem hiding this comment.
No need for these, they were already extern(D) so the C++ clients aren't using them.
|
@ibuclaw Since they were strictly extern(D) originally, the C++ clients were never hooking into them anyway. I've removed the wrappers from cxxfrontend.d, I went ahead and removed the C++ wrappers from cxxfrontend.d as suggested, but it looks like it triggered massive failures across the CI pipeline (all the C++ interop and linker tests are failing). It seems the CI tests might actually be relying on those extern (D) forwarders indirectly! Should I revert that specific commit to get the CI back to green, or is there a C++ header file somewhere else that I need to clean up? |
|
Thanks again for the guidance on the cxxfrontend.d wrappers, @ibuclaw Getting this pipeline right was my main goal before drafting my formal GSoC proposal. |
…r-expression-helpers
… after master merge
Following up on pr #22597 the architectural guidance from @ibuclaw. It focuses on migrating functions that perform actual semantic mutation on the AST.
Changes:
This successfully decouples tree-building logic from the pure data node while maintaining full C++ interoperability. I'd appreciate any review on whether the cxxfrontend.d wrappers align with the expected GDC/LDC integration patterns!