Page MenuHomePhabricator

[AsmPrinter] Use getMnemonic for instruction-mix remark.
ClosedPublic

Authored by fhahn on Oct 23 2020, 6:37 AM.

Details

Summary

This patch uses the new getMnemonic helper from D90039
to display mnemonics instead of the internal opcodes.

The main motivation behind using the mnemonics is that they
are more user-friendly and more directly related to the assembly
the users will be presented.

Diff Detail

Event Timeline

fhahn created this revision.Oct 23 2020, 6:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 23 2020, 6:37 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
fhahn requested review of this revision.Oct 23 2020, 6:37 AM
fhahn edited the summary of this revision. (Show Details)Oct 28 2020, 2:19 PM
fhahn updated this revision to Diff 301440.Oct 28 2020, 2:43 PM

Update the count by mnemonics

fhahn updated this revision to Diff 301443.Oct 28 2020, 2:51 PM

Document getMnemonic

fhahn updated this revision to Diff 303892.Mon, Nov 9, 8:45 AM

Rebase & ping :)

paquette added inline comments.Mon, Nov 16, 2:32 PM
llvm/include/llvm/MC/MCStreamer.h
457

Would it make sense to make this return an Optional to make it clear that this may not necessarily return a mnemonic?

arsenm added inline comments.Mon, Nov 16, 4:02 PM
llvm/include/llvm/MC/MCStreamer.h
457

empty string works well enough

paquette added inline comments.Mon, Nov 16, 4:36 PM
llvm/include/llvm/MC/MCStreamer.h
457

yeah you're probably right

This revision is now accepted and ready to land.Mon, Nov 16, 4:44 PM
This revision was landed with ongoing or failed builds.Tue, Nov 17, 4:13 AM
This revision was automatically updated to reflect the committed changes.
fhahn added inline comments.Tue, Nov 17, 5:58 AM
llvm/include/llvm/MC/MCStreamer.h
457

Thanks, I clarified the comment to mention when "" is returned. it should be easy to adjust, if there's a need or use case where Optional is more convenient.