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

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 07:50:22 PDT 2019


jhenderson 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 MarkupState and MarkupSpans.
+void X86ATTInstPrinter::printMarkedUpRegName(raw_ostream &OS, unsigned RegNo) {
----------------
seiya wrote:
> jhenderson wrote:
> > Could printRegName just be made non-const?
> We can't make it non-const because printRegName is defined as a virtual const function in MCInstPrinter. How about marking MarkupState `mutable` instead?
Obvious follow-up question: can printRegName in the base class be made non-const, or does that cause too many issues further along?

If not, I think I'd prefer this version be kept.


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