Please review fix for PR18919, that adds support for :vararg macro in integrated assembler.
Details
Diff Detail
Event Timeline
I'd like to see more tests here. .macro statements with normal arguments preceding the :vararg one. Something like:
.macro foo bar, baz:vararg ... .endmacro
A test without a comma between bar and baz would be good as well.
lib/MC/MCParser/AsmParser.cpp | ||
---|---|---|
1828–1829 | This comment is a bit hard to read, perhaps something more like: // We want the quotes around the string's contents when parsing for varargs. | |
3295 | Please use /*Varag=*/false to make it clear what is going on. |
Thank you guys!
Everything has been fixed according to your remarks:
- Fixed comments
- Added new tests
- I have also found small bug (thank you for test proposals again) and fixed it too.
test/MC/AsmParser/vararg.s | ||
---|---|---|
20 | Sorry for extra lines. Of course they will be removed! |
You should probably have a test with a darwin triple too. I cced Jim Grosbach for him to comment if this is a desirable feature for darwin or not. I know the macro system is a bit different, but I don't know the details.
Hi Rafael,
I have implementation for darwin, though in draft state.
There are few reasons/questions:
- I didn't find anything about vararg in darwin assembler reference. Or even some .s examples.
- If I remember properly, you can substitude parameters by their number: $0, $1, etc. So, may he then, you can refer to some of vararg params as well? Am I right here?
- Can I use whole varargs set substitution? Like in Linux tests?
- If answer to #2 and #3 is "yes", then I suspect we have to keep vararg values in two forms: as parsed and separated values, and as single string. We need second form, because we need to remember separators as well, in another words we have to expand it as-is. At least we have to keep separators for second form.
Anyway I'm ready to work on it too. But darwin support could contain a bit more changes. Perhaps we could commit it separately?
Please review updated patch.
- Added test, that checks :vararg state for darwin.
Thanks!
This comment is a bit hard to read, perhaps something more like: