Make `mkComment` work for all architectures
The Instruction
Type Class' mkComment
function should create an ASM comment.
But the current implementations for x86, PPC and SPARC look like this:
mkComment = const []
Only AARCH64 implements this.
Most likely because, e.g., x86 COMMENT
takes a FastString
(and AARCH64's an SDoc
).
In turn, this may be because CmmComment
has a FastString
.
Anyway, AARCH64 just converts this in CodeGen.hs.
Motivation
Adding comments to generated assembly can be very useful when debugging said assembly.
Proposal
I'd change x86, PPC and SPARC to work exactly like AARCH64, that is, change COMMENT
to take an SDoc
and convert from FastString
to SDoc
.
If there are no objections to this, I'd just create an MR.
(@angerman what do you say?)