Implement GccAsmStatement for gcc-style asm statements#8538
Implement GccAsmStatement for gcc-style asm statements#8538dlang-bot merged 5 commits intodlang:masterfrom
Conversation
|
Thanks for your pull request, @ibuclaw! 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#8538" |
94f63ef to
835a9ab
Compare
e3f7296 to
e8b9957
Compare
|
As title update suggests, renamed class to GccAsmStatement to avoid ambiguity. Added ddoc style comments, along with grammar outline of the parser. |
f67ab65 to
a3815e7
Compare
wilzbach
left a comment
There was a problem hiding this comment.
Reviewing this commit by commit was really straight-forward. Thank you!
src/dmd/iasmgcc.d
Outdated
| goto Ldone; | ||
|
|
||
| // No semicolon followed after instruction template, treat as extended asm. | ||
| for (int section = 0; section < 4; ++section) |
src/dmd/iasmgcc.d
Outdated
| // Analyse all input and output operands. | ||
| if (s.args) | ||
| { | ||
| for (size_t i = 0; i < s.args.dim; i++) |
There was a problem hiding this comment.
Could be a foreach (and the two for loops below too)
There was a problem hiding this comment.
If you mean foreach (i; 0 .. s.args.dim), then ok.
82d8eac to
db2ff45
Compare
|
Rebased; tweaked documented grammar so that there is no distinction between input and output operands; use foreach in a few places. |
|
@WalterBright - This is good to review I guess. |
|
Can tests be added? |
|
@jacob-carlborg unittests mimicking gdc? I guess so... |
I had a few ideas:
Unless somebody has a better idea. |
See latest commit.
DMD will always treat it like a dmd asm statement, so will error in same way as before.
That doesn't really help at all if we make changes to it, as for proper testing you should build GDC from source. You should probably have some faith in me that I vet my own compiler. :-) |
32e8394 to
5dc7986
Compare
Yes, but you're making changes to a project without adding tests to the project. But now I see that you've added tests 👍. |
PetarKirov
left a comment
There was a problem hiding this comment.
Nice work on the code and git commit separation!
|
SemaphoreCI failure is due to it checking out the wrong branch. This should be fixed by #8560 (once it's merged into |
|
:-O |
The AST itself is only used by GDC.
Parser and semantic analysis has been merged into a single function, and put in its own module as per #7562 (comment).
Lots more documentation could be added to the new functions that implement gcc asm.
Closes #7562.