This is an archive of the discontinued LLVM Phabricator instance.

[Target][MC] Cleaning up AssemblerDialect / InstructionPrinterSyntaxVariant
Needs ReviewPublic

Authored by rainerzufalldererste on Jul 20 2023, 3:17 PM.

Details

Summary

I'm fairly new to LLVM, so I'm not entirely sure if this is remotely something that'll ever get accepted, however, I've found the seemingly random integers representing various different syntax variants to be not particularly well documented and found the option to simply add a comment to be not particularly future proof. I apologize in advance if this change isn't appreciated as I'm not familiar with how such things are usually being improved, so I won't be upset if this is simply going to be rejected.

I've had another branch that included InlineAsm variants as well, but the rabbit hole was already a lot deeper than I originally anticipated, so I've left those changes out, unless otherwise requested.

I've only tagged the code-owners of projects that received meaningful changes, if this isn't correct, please let me know and I'll add everyone else as well.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald Transcript
rainerzufalldererste requested review of this revision.Jul 20 2023, 3:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2023, 3:17 PM
rainerzufalldererste retitled this revision from [Target][MC} Cleaning up AssemblerDialect / InstructionPrinterSyntaxVariant to [Target][MC] Cleaning up AssemblerDialect / InstructionPrinterSyntaxVariant.Jul 20 2023, 3:17 PM
MaskRay added inline comments.Jul 20 2023, 6:32 PM
llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
388

Nit: Delete the blank line and elsewhere.

llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
120–137

This is where I expected to be a good place for a point of separation - but my initial version also transitioned all of InlineAsm to the new enum.
I'm not sure how the inline assembly is supported across different target platforms, so please let me know whether that separation is justified.

llvm/lib/MC/MCDisassembler/Disassembler.cpp
324–325

The comment obviously needs to be removed, but I wasn't sure what the line is trying to achieve and there's probably a cleaner way to do it now.

llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.h
18

Would you prefer to keep this around, even through it's now unused (for potential backwards-compatibility)?

rainerzufalldererste marked an inline comment as done.