[llvm-dev] llvm-objdump: syntax highlighting based on rich disassembly
Seiya Nuta via llvm-dev
llvm-dev at lists.llvm.org
Wed Jul 24 00:20:35 PDT 2019
Hi all,
I've uploaded the series of patches for this feature (you can see some
screenshots on the Phabricator):
https://reviews.llvm.org/D65191
On Mon, Jul 8, 2019 at 5:20 PM Seiya Nuta <nuta at seiya.me> wrote:
>
> Hi all,
>
> I'm going to implement syntax highlighting in llvm-objdump based on
> Rich Disassembly[1] and I'd like to hear your comments on how should I
> implement it. Now I have two ideas to implement the feature:
>
> (a) Make MCInstPrinter return a well-typed value and traverse it in
> llvm-objdump to highlight the disassembly.
> (b) Parse the rich disassembly output string in the llvm-objdump and
> highlight the disassembly.
>
> Making MCInstPrinter return the "well-typed" marked-up value just like
> abstract syntax tree instead of writing an annotated string into a
> raw_ostream sounds more preferable way to me. However, it would
> involve large changes to the existing MCInstPrinter implementations.
>
> In contrast, parsing the rich disassembly output in llvm-objdump
> sounds a bit awkward, but we don't need to change the MCInstPrinter at
> all. That said, parsing the text surely degrades the disassemble
> performance so we should disable the parsing and highlighting by
> default. I wrote and uploaded a prototype of this [2].
>
> Do you have any thoughts?
>
> Thanks,
> Seiya
>
> [1] https://llvm.org/docs/MarkedUpDisassembly.html
> [2] https://reviews.llvm.org/D64311
More information about the llvm-dev
mailing list