[llvm-commits] [llvm] r95186 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Chris Lattner
sabre at nondot.org
Tue Feb 2 17:46:06 PST 2010
Author: lattner
Date: Tue Feb 2 19:46:05 2010
New Revision: 95186
URL: http://llvm.org/viewvc/llvm-project?rev=95186&view=rev
Log:
privatize a bunch of methods and move \n printing into them.
Modified:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=95186&r1=95185&r2=95186&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Tue Feb 2 19:46:05 2010
@@ -307,7 +307,6 @@
/// printLabel - This method prints a local label used by debug and
/// exception handling tables.
- void printLabel(const MachineInstr *MI) const;
void printLabel(unsigned Id) const;
/// printDeclare - This method prints a local variable declaration used by
@@ -366,10 +365,17 @@
virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV);
+ /// printOffset - This is just convenient handler for printing offsets.
+ void printOffset(int64_t Offset) const;
+
+ private:
+
/// processDebugLoc - Processes the debug information of each machine
/// instruction's DebugLoc.
void processDebugLoc(const MachineInstr *MI, bool BeforePrintingInsn);
+ void printLabelInst(const MachineInstr *MI) const;
+
/// printInlineAsm - This method formats and prints the specified machine
/// instruction that is an inline asm.
void printInlineAsm(const MachineInstr *MI) const;
@@ -381,10 +387,6 @@
/// printKill - This method prints the specified kill machine instruction.
void printKill(const MachineInstr *MI) const;
- /// printOffset - This is just convenient handler for printing offsets.
- void printOffset(int64_t Offset) const;
-
- private:
/// EmitVisibility - This emits visibility information about symbol, if
/// this is suported by the target.
void EmitVisibility(MCSymbol *Sym, unsigned Visibility) const;
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=95186&r1=95185&r2=95186&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Feb 2 19:46:05 2010
@@ -350,20 +350,16 @@
case TargetInstrInfo::DBG_LABEL:
case TargetInstrInfo::EH_LABEL:
case TargetInstrInfo::GC_LABEL:
- printLabel(II);
- O << '\n';
+ printLabelInst(II);
break;
case TargetInstrInfo::INLINEASM:
printInlineAsm(II);
- O << '\n';
break;
case TargetInstrInfo::IMPLICIT_DEF:
printImplicitDef(II);
- O << '\n';
break;
case TargetInstrInfo::KILL:
printKill(II);
- O << '\n';
break;
default:
EmitInstruction(II);
@@ -1429,7 +1425,7 @@
}
}
}
- O << "\n\t" << MAI->getCommentString() << MAI->getInlineAsmEnd();
+ O << "\n\t" << MAI->getCommentString() << MAI->getInlineAsmEnd() << '\n';
}
/// printImplicitDef - This method prints the specified machine instruction
@@ -1438,7 +1434,7 @@
if (!VerboseAsm) return;
O.PadToColumn(MAI->getCommentColumn());
O << MAI->getCommentString() << " implicit-def: "
- << TRI->getName(MI->getOperand(0).getReg());
+ << TRI->getName(MI->getOperand(0).getReg()) << '\n';
}
void AsmPrinter::printKill(const MachineInstr *MI) const {
@@ -1450,12 +1446,14 @@
assert(op.isReg() && "KILL instruction must have only register operands");
O << ' ' << TRI->getName(op.getReg()) << (op.isDef() ? "<def>" : "<kill>");
}
+ O << '\n';
}
/// printLabel - This method prints a local label used by debug and
/// exception handling tables.
-void AsmPrinter::printLabel(const MachineInstr *MI) const {
+void AsmPrinter::printLabelInst(const MachineInstr *MI) const {
printLabel(MI->getOperand(0).getImm());
+ O << '\n';
}
void AsmPrinter::printLabel(unsigned Id) const {
More information about the llvm-commits
mailing list