[PATCH] D41610: [X86] Implementation of X86Operand::print

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 9 10:42:51 PST 2018


craig.topper added inline comments.


================
Comment at: lib/Target/X86/AsmParser/X86Operand.h:39
   bool AddressOf;
+  const MCRegisterInfo *MRI;
 
----------------
Why isn't this part of the RegOp struct? Though I suggested a way we can remove this entirely further down.


================
Comment at: lib/Target/X86/AsmParser/X86Operand.h:121
+      assert(MRI && "Invalid register operand");
+      OS << "Reg:" << MRI->getName(Reg.RegNo);
+      break;
----------------
It would print lower case instead of upper case, but I think you can use X86IntelInstPrinter::getRegisterName which is a static method and then you wouldn't have to pass MRI around.


https://reviews.llvm.org/D41610





More information about the llvm-commits mailing list