[PATCH] D65190: [X86] X86ATTInstPrinter: replace markup with startMarkup/endMarkup

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 10:26:16 PDT 2019


rupprecht accepted this revision.
rupprecht added inline comments.


================
Comment at: llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.cpp:41-42
+
+// Since printRegName is a const method, we need this non-const version to
+// update MarkupSpans.
+void X86ATTInstPrinter::printMarkedUpRegName(raw_ostream &OS, unsigned RegNo) {
----------------
What if instead of adding this method, you make the MarkupSpans fields `mutable` so startMarkup/endMarkup can be marked const? This would enable markup support more broadly for other tools that call this method.
Alternatively, my other suggestion of replacing endMarkup() w/ a destructor on MarkupStart would allow MarkupStart itself to own the MarkupSpans, making it naturally const.

(I think this is fine to commit as-is and address in a later patch)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65190/new/

https://reviews.llvm.org/D65190





More information about the llvm-commits mailing list