[llvm-commits] CVS: llvm/lib/Target/X86/X86AsmPrinter.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Aug 1 01:22:39 PDT 2004



Changes in directory llvm/lib/Target/X86:

X86AsmPrinter.cpp updated: 1.109 -> 1.110

---
Log message:

Get rid of 3 of the 4 'printimplicit' flags.  Implicit operands are now 
explicitly listed in the asm string.



---
Diffs of the changes:  (+1 -79)

Index: llvm/lib/Target/X86/X86AsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.109 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.110
--- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.109	Sun Aug  1 03:12:41 2004
+++ llvm/lib/Target/X86/X86AsmPrinter.cpp	Sun Aug  1 03:22:29 2004
@@ -115,10 +115,7 @@
       }
     }
 
-    void printImplUsesBefore(const TargetInstrDescriptor &Desc);
-    bool printImplDefsBefore(const TargetInstrDescriptor &Desc);
     bool printImplUsesAfter(const TargetInstrDescriptor &Desc, const bool LC);
-    bool printImplDefsAfter(const TargetInstrDescriptor &Desc, const bool LC);
     void printMachineInstruction(const MachineInstr *MI);
     void printOp(const MachineOperand &MO, bool elideOffsetKeyword = false);
     void printMemReference(const MachineInstr *MI, unsigned Op);
@@ -538,44 +535,6 @@
   O << "]";
 }
 
-
-/// printImplUsesBefore - Emit the implicit-use registers for the instruction
-/// described by DESC, if its PrintImplUsesBefore flag is set.
-///
-void X86AsmPrinter::printImplUsesBefore(const TargetInstrDescriptor &Desc) {
-  const MRegisterInfo &RI = *TM.getRegisterInfo();
-  if (Desc.TSFlags & X86II::PrintImplUsesBefore) {
-    for (const unsigned *p = Desc.ImplicitUses; *p; ++p) {
-      // Bug Workaround: See note in X86AsmPrinter::doInitialization about %.
-      O << "%" << RI.get(*p).Name << ", ";
-    }
-  }
-}
-
-/// printImplDefsBefore - Emit the implicit-def registers for the instruction
-/// described by DESC, if its PrintImplUsesBefore flag is set.  Return true if
-/// we printed any registers.
-///
-bool X86AsmPrinter::printImplDefsBefore(const TargetInstrDescriptor &Desc) {
-  bool Printed = false;
-  const MRegisterInfo &RI = *TM.getRegisterInfo();
-  if (Desc.TSFlags & X86II::PrintImplDefsBefore) {
-    const unsigned *p = Desc.ImplicitDefs;
-    if (*p) {
-      O << (Printed ? ", %" : "%") << RI.get (*p).Name;
-      Printed = true;
-      ++p;
-    }
-    while (*p) {
-      // Bug Workaround: See note in X86AsmPrinter::doInitialization about %.
-      O << ", %" << RI.get(*p).Name;
-      ++p;
-    }
-  }
-  return Printed;
-}
-
-
 /// printImplUsesAfter - Emit the implicit-use registers for the instruction
 /// described by DESC, if its PrintImplUsesAfter flag is set.
 ///
@@ -608,38 +567,6 @@
   return false;
 }
 
-/// printImplDefsAfter - Emit the implicit-definition registers for the
-/// instruction described by DESC, if its PrintImplDefsAfter flag is set.
-///
-/// Inputs:
-///   Comma - List of registers will need a leading comma.
-///   Desc  - Description of the Instruction
-///
-/// Return value:
-///   true  - Emitted one or more registers.
-///   false - Emitted no registers.
-///
-bool X86AsmPrinter::printImplDefsAfter(const TargetInstrDescriptor &Desc,
-                                       const bool Comma = true) {
-  const MRegisterInfo &RI = *TM.getRegisterInfo();
-  if (Desc.TSFlags & X86II::PrintImplDefsAfter) {
-    bool emitted = false;
-    const unsigned *p = Desc.ImplicitDefs;
-    if (*p) {
-      O << (Comma ? ", %" : "%") << RI.get (*p).Name;
-      emitted = true;
-      ++p;
-    }
-    while (*p) {
-      // Bug Workaround: See note in X86AsmPrinter::doInitialization about %.
-      O << ", %" << RI.get(*p).Name;
-      ++p;
-    }
-    return emitted;
-  }
-  return false;
-}
-
 /// printMachineInstruction -- Print out a single X86 LLVM instruction
 /// MI in Intel syntax to the current output stream.
 ///
@@ -703,14 +630,11 @@
            "Illegal raw instruction!");
     O << TII.getName(MI->getOpcode()) << " ";
 
-    bool LeadingComma = printImplDefsBefore(Desc);
-
+    bool LeadingComma = false;
     if (MI->getNumOperands() == 1) {
-      if (LeadingComma) O << ", ";
       printOp(MI->getOperand(0), true); // Don't print "OFFSET"...
       LeadingComma = true;
     }
-    LeadingComma = printImplDefsAfter(Desc, LeadingComma) || LeadingComma;
     printImplUsesAfter(Desc, LeadingComma);
     O << "\n";
     return;
@@ -739,8 +663,6 @@
     
     O << TII.getName(MI->getOpcode()) << " ";
 
-    printImplUsesBefore(Desc);   // fcmov*
-
     printOp(MI->getOperand(0));
     if (MI->getNumOperands() == 2 &&
         (!MI->getOperand(1).isRegister() ||





More information about the llvm-commits mailing list