This is a prototype implementation of syntax highlighting. I'll split into separate patches, but before that I'd like to discuss the
outline to make sure that I’m on the right track.
Details
- Reviewers
- None
Diff Detail
Event Timeline
Something to be aware of is that people can change how the output is printed using switches like --x86-asm-syntax. If you're going down the route of parsing the text to identify how to highlight it, your parser needs to be robust enough to cope. Not only that but different architectures have different disassembly output, so there's a similar issue there.
- Hold the vector of marked up fragments instead of parsing the disassembly (suggested by Michael Spencer on llvm-dev).
llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.cpp | ||
---|---|---|
42 | I think implementing operator<< would be better. |
- Implement raw_ostream &operator<<(...).
- Support nested marked-up string (e.g., <mem:256(<reg:%rip>)>).
llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.cpp | ||
---|---|---|
376 | TODO: remove |
I'll add tests and split into separate patches later but before that I'd like to discuss the outline to make sure that I’m on the right track.
Hi @seiya. As mentioned by email offline, I think this looks quite good. Please go ahead and add some reviewers, and write some tests for it. I'm happy to help out with reviewing it in more detail once it's ready.
I think implementing operator<< would be better.