Handle registers a bit more efficiently
authorChris Lattner <sabre@nondot.org>
Sun, 1 Aug 2004 08:12:41 +0000 (08:12 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 1 Aug 2004 08:12:41 +0000 (08:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15395 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86AsmPrinter.cpp

index 70eae63a8e397df0cefe41643b06fcfe3c05a6bf..09913c271891d1cfaaada67da3e6c71600f2906e 100644 (file)
@@ -106,7 +106,13 @@ namespace {
 
     // This method is used by the tablegen'erated instruction printer.
     void printOperand(const MachineOperand &MO, MVT::ValueType VT) {
-      printOp(MO);
+      if (MO.getType() == MachineOperand::MO_MachineRegister) {
+        assert(MRegisterInfo::isPhysicalRegister(MO.getReg())&&"Not physref??");
+        // Bug Workaround: See note in Printer::doInitialization about %.
+        O << "%" << TM.getRegisterInfo()->get(MO.getReg()).Name;
+      } else {
+        printOp(MO);
+      }
     }
 
     void printImplUsesBefore(const TargetInstrDescriptor &Desc);