Get rid of postInstructionAction and call EmitComments directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75806 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Greene 2009-07-15 18:24:03 +00:00
parent 87d1f47cb6
commit fe7b16fe65
2 changed files with 9 additions and 23 deletions

View File

@ -333,16 +333,10 @@ namespace llvm {
/// debug tables. /// debug tables.
void printDeclare(const MachineInstr *MI) const; void printDeclare(const MachineInstr *MI) const;
/// postInstructionAction - Handling printing of items after the /// EmitComments - Pretty-print comments for instructions
/// instruction iteself has been printed (e.g. comments) void EmitComments(const MachineInstr &MI) const;
void postInstructionAction(const MachineInstr &MI) const { /// EmitComments - Pretty-print comments for instructions
postInstructionActionImpl(MI); void EmitComments(const MCInst &MI) const;
EmitComments(MI);
}
void postInstructionAction(const MCInst &MI) const {
postInstructionActionImpl(MI);
EmitComments(MI);
}
protected: protected:
/// EmitZeros - Emit a block of zeros. /// EmitZeros - Emit a block of zeros.
@ -413,14 +407,6 @@ namespace llvm {
void EmitGlobalConstantFP(const ConstantFP* CFP, unsigned AddrSpace); void EmitGlobalConstantFP(const ConstantFP* CFP, unsigned AddrSpace);
void EmitGlobalConstantLargeInt(const ConstantInt* CI, unsigned AddrSpace); void EmitGlobalConstantLargeInt(const ConstantInt* CI, unsigned AddrSpace);
GCMetadataPrinter *GetOrCreateGCPrinter(GCStrategy *C); 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 {}
}; };
} }

View File

@ -383,7 +383,7 @@ FindUniqueOperandCommands(std::vector<std::string> &UniqueOperandCommands,
// If this is the last operand, emit a return. // If this is the last operand, emit a return.
if (Inst->Operands.size() == 1) { if (Inst->Operands.size() == 1) {
Command += " postInstructionAction(*MI);\n"; Command += " EmitComments(*MI);\n";
// Print the final newline // Print the final newline
Command += " O << \"\\n\";\n"; Command += " O << \"\\n\";\n";
Command += " return true;\n"; Command += " return true;\n";
@ -454,7 +454,7 @@ FindUniqueOperandCommands(std::vector<std::string> &UniqueOperandCommands,
// If this is the last operand, emit a return after the code. // If this is the last operand, emit a return after the code.
if (FirstInst->Operands.size() == Op+1) { if (FirstInst->Operands.size() == Op+1) {
Command += " postInstructionAction(*MI);\n"; Command += " EmitComments(*MI);\n";
// Print the final newline // Print the final newline
Command += " O << \"\\n\";\n"; Command += " O << \"\\n\";\n";
Command += " return true;\n"; Command += " return true;\n";
@ -570,7 +570,7 @@ void AsmWriterEmitter::run(raw_ostream &O) {
// just opcode strings to use. // just opcode strings to use.
if (isFirst) { if (isFirst) {
// Do the post instruction processing and print the final newline // 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; isFirst = false;
} }
@ -745,7 +745,7 @@ void AsmWriterEmitter::run(raw_ostream &O) {
EmitInstructions(Instructions, O); EmitInstructions(Instructions, O);
O << " }\n"; O << " }\n";
O << " postInstructionAction(*MI);\n"; O << " EmitComments(*MI);\n";
// Print the final newline // Print the final newline
O << " O << \"\\n\";\n"; O << " O << \"\\n\";\n";
O << " return true;\n"; O << " return true;\n";