SystemZ assembly syntax emission now leverages markup tags, if enabled.
Details
Diff Detail
Event Timeline
Can you explain what this is, and where this marked-up assembler could be useful? I see so far only ARM supports that feature, but I don't really understand the point ...
@uweigand, mostly third-party clients such as disassemblers and pretty printers, as per official documentation. Already supported by ARM as well as x64.
Do you have any example of such tools? The reason I'm asking is that it's a bit hard for me to judge whether the implementation is fully complete and would make those uses cases actually work, without seeing any.
As a comment on the implementation: I think it would be much preferable to use the base class UseMarkup member (or even better, the markup helper), instead of having to explicitly pass on the extra argument. I guess the reason you're not doing this is because of the calls from PrintAsmOperand / PrintMemAsmOperand? This actually makes me wonder if it wouldn't be cleaner to just duplicate the (small amount of) code in printOperand and printAddress into PrintAsmOperand and PrintMemAsmOperand, and then stop making all those SystemZInstrPrinter routines static ...
@uweigand, we leverage LLVM disassembler (and, specifically, MCInstPrinter::printInst) as part of our static binary translator tool, here, though I assume I could count many other uses that I'm not aware of (we've updated other targets too in order to support markup).
I'm actually using UseMarkup member field anywhere, except for the static functions – whose callers are PrintAsmOperand / PrintMemAsmOperand, as you noted – for which, clearly, I could not. I reckon it's not really that big of a deal, being limited to a very small portion of the code.
Test fixed.
@MaskRay, test added for this patch too, failure of unit tests seems completely unrelated to the change.
@MaskRay, as there do not seem to be further concerns, could you kindly commit this on my behalf please (I do not have commit access)?
Sorry for the delay, I was traveling last week. Thanks for the use case, it's good to have some validation that the output in this form is actually usable.
As to the implementation, I still believe it would be better to eliminate the static routines as outlined in my last comment. Do you think you could give that a try?
Hello @uweigand, I apologize for being late on this. From the build, it looks like some systemz tests are failing because the register name is actually not emitted. Is it possible that I'm not handling properly it via SystemZInstPrinter::getRegisterName? Do you have any clue by any chance? The duplicated code in SystemZAsmPrinter.cpp looks correct to me.
@uweigand, thanks for reviewing them! Might I ask you to commit it on my behalf, please (as I do not have commit access, account associated to GitHub)? Thank you.
You've removed the RegName here.