[llvm-commits] [llvm] r75806 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h utils/TableGen/AsmWriterEmitter.cpp

David Greene greened at obbligato.org
Wed Jul 15 11:24:03 PDT 2009


Author: greened
Date: Wed Jul 15 13:24:03 2009
New Revision: 75806

URL: http://llvm.org/viewvc/llvm-project?rev=75806&view=rev
Log:

Get rid of postInstructionAction and call EmitComments directly.

Modified:
    llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
    llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp

Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=75806&r1=75805&r2=75806&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Wed Jul 15 13:24:03 2009
@@ -333,17 +333,11 @@
     /// debug tables.
     void printDeclare(const MachineInstr *MI) const;
 
-    /// postInstructionAction - Handling printing of items after the
-    /// instruction iteself has been printed (e.g. comments)
-    void postInstructionAction(const MachineInstr &MI) const {
-      postInstructionActionImpl(MI);
-      EmitComments(MI);
-    }
-    void postInstructionAction(const MCInst &MI) const {
-      postInstructionActionImpl(MI);
-      EmitComments(MI);
-    }
-    
+    /// EmitComments - Pretty-print comments for instructions
+    void EmitComments(const MachineInstr &MI) const;
+    /// EmitComments - Pretty-print comments for instructions
+    void EmitComments(const MCInst &MI) const;
+
   protected:
     /// EmitZeros - Emit a block of zeros.
     ///
@@ -413,14 +407,6 @@
     void EmitGlobalConstantFP(const ConstantFP* CFP, unsigned AddrSpace);
     void EmitGlobalConstantLargeInt(const ConstantInt* CI, unsigned AddrSpace);
     GCMetadataPrinter *GetOrCreateGCPrinter(GCStrategy *C);
-
-    /// EmitComments - Pretty-print comments for instructions
-    void EmitComments(const MachineInstr &MI) const;
-    /// EmitComments - Pretty-print comments for instructions
-    void EmitComments(const MCInst &MI) const;
-
-    virtual void postInstructionActionImpl(const MachineInstr &MI) const {}
-    virtual void postInstructionActionImpl(const MCInst &MI) const {}
   };
 }
 

Modified: llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp?rev=75806&r1=75805&r2=75806&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp Wed Jul 15 13:24:03 2009
@@ -383,7 +383,7 @@
 
     // If this is the last operand, emit a return.
     if (Inst->Operands.size() == 1) {
-      Command += "    postInstructionAction(*MI);\n";
+      Command += "    EmitComments(*MI);\n";
       // Print the final newline
       Command += "    O << \"\\n\";\n";
       Command += "    return true;\n";
@@ -454,7 +454,7 @@
       
       // If this is the last operand, emit a return after the code.
       if (FirstInst->Operands.size() == Op+1) {
-        Command += "    postInstructionAction(*MI);\n";
+        Command += "    EmitComments(*MI);\n";
         // Print the final newline
         Command += "    O << \"\\n\";\n";
         Command += "    return true;\n";
@@ -570,7 +570,7 @@
     // just opcode strings to use.
     if (isFirst) {
       // Do the post instruction processing and print the final newline
-      UniqueOperandCommands.push_back("    postInstructionAction(*MI);\n    O << \"\\n\";\n    return true;\n");
+      UniqueOperandCommands.push_back("    EmitComments(*MI);\n    O << \"\\n\";\n    return true;\n");
       isFirst = false;
     }
 
@@ -745,7 +745,7 @@
       EmitInstructions(Instructions, O);
 
     O << "  }\n";
-    O << "  postInstructionAction(*MI);\n";
+    O << "  EmitComments(*MI);\n";
     // Print the final newline
     O << "  O << \"\\n\";\n";
     O << "  return true;\n";





More information about the llvm-commits mailing list