[WIP] Translate _d_arraycatnTX to template#10064
Conversation
@WalterBright Could you please lend your expertise to help us solve the backend assertion failure? |
I believe you should be able to do that with Though I'm not sure how to do that when all you have is an array of Expressions. I'll look into it. Edit: Gah, you can't do that. You have to do it at the function declaration site. I guess I don't understand. Please clarify. |
16ef63e to
45e13d4
Compare
b6be734 to
b0e932e
Compare
|
Thanks for your pull request and interest in making D better, @Vild! 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 fetch digger
dub run digger -- build "master + dmd#10064" |
Signed-off-by: Dan Printzell <xwildn00bx@gmail.com>
Signed-off-by: Dan Printzell <xwildn00bx@gmail.com>
Signed-off-by: Dan Printzell <xwildn00bx@gmail.com>
Signed-off-by: Dan Printzell <xwildn00bx@gmail.com>
Signed-off-by: Dan Printzell <xwildn00bx@gmail.com>
Without this the first argument turns into a `string` src/dmd/mars.d(2174): Error: function `dmd.mars.parseCommandLine.error(const(char)* format, const(char*) arg = null)` is not callable using argument types `(string, const(char)*)` Signed-off-by: Dan Printzell <xwildn00bx@gmail.com>
bacbf8e to
0a24ab8
Compare
|
|
||
| Expression ea = (*e.arguments)[0]; | ||
|
|
||
| while (true) |
There was a problem hiding this comment.
You have used a simpler while(ea.isCastExp()) ea = ea.isCastExp().e1; elsewhere.
| } | ||
|
|
||
| if (global.params.verbose) | ||
| message("interpret %s =>\n %s", e.toChars(), e1.toChars()); |
There was a problem hiding this comment.
Do not use message for your debug output, use versioned printf instead.
| exp.type = tb1next.arrayOf(); | ||
| L2elem: | ||
| if (tb2.ty == Tarray || tb2.ty == Tsarray) | ||
| if (tb2.ty != Tarray && tb2.ty != Tsarray) |
There was a problem hiding this comment.
Why can you completely invert the condition here?
| result = exp.optimize(WANTvalue); | ||
| return; | ||
| e = exp.optimize(WANTvalue); | ||
| goto Lrewrite; |
There was a problem hiding this comment.
Can you place the rewriting into a (local) function instead of having to use goto?
| if (!flag) | ||
| { | ||
| error("unknown JSON field `-Xi=%s`, expected one of " ~ jsonFieldNames, p + 4); | ||
| error(cast(const(char)*)("unknown JSON field `-Xi=%s`, expected one of " ~ jsonFieldNames), p + 4); |
There was a problem hiding this comment.
I haven't looked closely at the actual rewrite, but if it needs this additional cast (probably concatenation moved from CT to RT) it will break quite some code,
|
Closing as @teodutu is taking care of this. |
druntime PR: dlang/druntime#2648
These patches will lower
a ~ ato(S[][2] __cat2 = [arr1, arr1];) , _d_arraycatnTX(cast(S[][])__cat2).