This is an archive of the discontinued LLVM Phabricator instance.

[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.Nov 9 2020, 8:45 AM

Rebase & ping :)

paquette added inline comments.Nov 16 2020, 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.Nov 16 2020, 4:02 PM
llvm/include/llvm/MC/MCStreamer.h
457

empty string works well enough

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

yeah you're probably right

This revision is now accepted and ready to land.Nov 16 2020, 4:44 PM
This revision was landed with ongoing or failed builds.Nov 17 2020, 4:13 AM
This revision was automatically updated to reflect the committed changes.
fhahn added inline comments.Nov 17 2020, 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.