Implement visitor for toExpression functions#7049
Conversation
|
Thanks for your pull request, @RazvanN7! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Some tips to help speed things up:
Bear in mind that large or tricky changes may require multiple rounds of review and revision. Please see CONTRIBUTING.md for more information. 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. |
|
You added a new file which now contains semantically unrelated code in close visual proximity. |
|
The |
fa8daf3 to
8a7d383
Compare
|
I love it how the autotester passes all tests and the rest are red |
2a5fffe to
b831f86
Compare
|
@WalterBright done. Is it ok now? |
|
I thought about aliasing the functions to |
|
Ran speed measurements in the same manner as #7031. Baseline (master): With this PR: Minimum: 5.423 (this PR) vs 5.446 (master) This PR is at worst as fast as master. |
|
@WalterBright |
andralex
left a comment
There was a problem hiding this comment.
@ibuclaw @redstar @klickverbot @MartinNowak could you please take a look
|
@andralex aliasSeq is a type. yet it can hold expressions. |
| } | ||
| } | ||
|
|
||
| extern (C++) Expression typeToExpression(Type t) |
| return v.result; | ||
| } | ||
|
|
||
| extern (C++) Expression typeToExpressionHelper(TypeQualified t, Expression e, size_t i = 0) |
| } | ||
| } | ||
|
|
||
| public extern (C++) Expression initializerToExpression(Initializer i, Type t = null) |
|
@WalterBright I added doc comments for those functions. |
|
@RazvanN7 This broke newCTFE. |
|
@RazvanN7 How do I get the Thanks! |
|
|
|
@UplinkCoder As ZombineDev pointed out you have to use initializerToExpression for initializer nodes and typeToExpression for type nodes. I think these names are more expressive than toExpression. |
Related PRs: