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

Seiya Nuta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 31 02:54:33 PDT 2019


seiya marked 3 inline comments as done.
seiya 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) {
----------------
jhenderson wrote:
> 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.
I should have explain that as well. I've tried making it non-const but changes spread out (mainly around AsmParser) in the code base. printMarkedUpRegName is a simple solution for this.


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