aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-03 01:09:55 +0000
committerChris Lattner <sabre@nondot.org>2010-02-03 01:09:55 +0000
commitd1ff72b8a797304f146e4293db8c814231ea8cb3 (patch)
treef5933f6d4223c094abac69d75fdba2b8033e90af /lib
parent0d883e3f8484491d010b8f8b7a1aecc58cb5fa8e (diff)
downloadexternal_llvm-d1ff72b8a797304f146e4293db8c814231ea8cb3.zip
external_llvm-d1ff72b8a797304f146e4293db8c814231ea8cb3.tar.gz
external_llvm-d1ff72b8a797304f146e4293db8c814231ea8cb3.tar.bz2
rejigger the world so that EmitInstruction prints the \n at
the end of the instruction instead of expecting the caller to do it. This currently causes the asm-verbose instruction comments to be on the next line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95178 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp30
-rw-r--r--lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp1
-rw-r--r--lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp5
-rw-r--r--lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp5
-rw-r--r--lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp1
-rw-r--r--lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp1
-rw-r--r--lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp5
-rw-r--r--lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp4
-rw-r--r--lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp1
-rw-r--r--lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp1
-rw-r--r--lib/Target/X86/AsmPrinter/X86MCInstLower.cpp4
-rw-r--r--lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp1
12 files changed, 37 insertions, 22 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 71668f5..3358d04 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -351,15 +351,19 @@ void AsmPrinter::EmitFunctionBody() {
case TargetInstrInfo::EH_LABEL:
case TargetInstrInfo::GC_LABEL:
printLabel(II);
+ O << '\n';
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);
@@ -367,7 +371,6 @@ void AsmPrinter::EmitFunctionBody() {
}
if (VerboseAsm)
EmitComments(*II);
- O << '\n';
// FIXME: Clean up processDebugLoc.
processDebugLoc(II, false);
@@ -1580,7 +1583,7 @@ static void PrintChildLoopComment(raw_ostream &OS, const MachineLoop *Loop,
}
}
-/// EmitComments - Pretty-print comments for basic blocks.
+/// PrintBasicBlockLoopComments - Pretty-print comments for basic blocks.
static void PrintBasicBlockLoopComments(const MachineBasicBlock &MBB,
const MachineLoopInfo *LI,
const AsmPrinter &AP) {
@@ -1716,8 +1719,6 @@ void AsmPrinter::EmitComments(const MachineInstr &MI) const {
if (!VerboseAsm)
return;
- bool Newline = false;
-
if (!MI.getDebugLoc().isUnknown()) {
DILocation DLT = MF->getDILocation(MI.getDebugLoc());
@@ -1733,7 +1734,7 @@ void AsmPrinter::EmitComments(const MachineInstr &MI) const {
O << ':' << DLT.getLineNumber();
if (DLT.getColumnNumber() != 0)
O << ':' << DLT.getColumnNumber();
- Newline = true;
+ O << '\n';
}
// Check for spills and reloads
@@ -1748,37 +1749,29 @@ void AsmPrinter::EmitComments(const MachineInstr &MI) const {
if (TM.getInstrInfo()->isLoadFromStackSlotPostFE(&MI, FI)) {
if (FrameInfo->isSpillSlotObjectIndex(FI)) {
MMO = *MI.memoperands_begin();
- if (Newline) O << '\n';
O.PadToColumn(MAI->getCommentColumn());
- O << MAI->getCommentString() << ' ' << MMO->getSize() << "-byte Reload";
- Newline = true;
+ O << MAI->getCommentString() << ' ' << MMO->getSize() << "-byte Reload\n";
}
}
else if (TM.getInstrInfo()->hasLoadFromStackSlot(&MI, MMO, FI)) {
if (FrameInfo->isSpillSlotObjectIndex(FI)) {
- if (Newline) O << '\n';
O.PadToColumn(MAI->getCommentColumn());
O << MAI->getCommentString() << ' '
- << MMO->getSize() << "-byte Folded Reload";
- Newline = true;
+ << MMO->getSize() << "-byte Folded Reload\n";
}
}
else if (TM.getInstrInfo()->isStoreToStackSlotPostFE(&MI, FI)) {
if (FrameInfo->isSpillSlotObjectIndex(FI)) {
MMO = *MI.memoperands_begin();
- if (Newline) O << '\n';
O.PadToColumn(MAI->getCommentColumn());
- O << MAI->getCommentString() << ' ' << MMO->getSize() << "-byte Spill";
- Newline = true;
+ O << MAI->getCommentString() << ' ' << MMO->getSize() << "-byte Spill\n";
}
}
else if (TM.getInstrInfo()->hasStoreToStackSlot(&MI, MMO, FI)) {
if (FrameInfo->isSpillSlotObjectIndex(FI)) {
- if (Newline) O << '\n';
O.PadToColumn(MAI->getCommentColumn());
O << MAI->getCommentString() << ' '
- << MMO->getSize() << "-byte Folded Spill";
- Newline = true;
+ << MMO->getSize() << "-byte Folded Spill\n";
}
}
@@ -1787,9 +1780,8 @@ void AsmPrinter::EmitComments(const MachineInstr &MI) const {
if (TM.getInstrInfo()->isMoveInstr(MI, SrcReg, DstReg,
SrcSubIdx, DstSubIdx)) {
if (MI.getAsmPrinterFlag(ReloadReuse)) {
- if (Newline) O << '\n';
O.PadToColumn(MAI->getCommentColumn());
- O << MAI->getCommentString() << " Reload Reuse";
+ O << MAI->getCommentString() << " Reload Reuse\n";
}
}
}
diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
index 3f0bd61..7e22b62 100644
--- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
+++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
@@ -1034,6 +1034,7 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
EmitAlignment(2);
printInstruction(MI);
+ O << '\n';
}
}
diff --git a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
index f512256..03a49b2 100644
--- a/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
+++ b/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
@@ -45,7 +45,10 @@ namespace {
return "Alpha Assembly Printer";
}
void printInstruction(const MachineInstr *MI);
- void EmitInstruction(const MachineInstr *MI) { printInstruction(MI); }
+ void EmitInstruction(const MachineInstr *MI) {
+ printInstruction(MI);
+ O << '\n';
+ }
static const char *getRegisterName(unsigned RegNo);
void printOp(const MachineOperand &MO, bool IsCallOp = false);
diff --git a/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp b/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp
index 56a1462..885e697 100644
--- a/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp
+++ b/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp
@@ -52,7 +52,10 @@ namespace {
void printInstruction(const MachineInstr *MI); // autogenerated.
static const char *getRegisterName(unsigned RegNo);
- void EmitInstruction(const MachineInstr *MI) { printInstruction(MI); }
+ void EmitInstruction(const MachineInstr *MI) {
+ printInstruction(MI);
+ O << '\n';
+ }
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
unsigned AsmVariant, const char *ExtraCode);
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
diff --git a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
index 92736c2..db653a7 100644
--- a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
+++ b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
@@ -58,6 +58,7 @@ namespace {
void EmitInstruction(const MachineInstr *MI) {
printInstruction(MI);
+ O << '\n';
}
void printOp(const MachineOperand &MO);
diff --git a/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp b/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp
index 14e39f9..20cbde8 100644
--- a/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp
+++ b/lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp
@@ -184,6 +184,7 @@ void MSP430AsmPrinter::EmitInstruction(const MachineInstr *MI) {
MCInst TmpInst;
MCInstLowering.Lower(MI, TmpInst);
printMCInst(&TmpInst);
+ O << '\n';
}
static MCInstPrinter *createMSP430MCInstPrinter(const Target &T,
diff --git a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
index 4118e7b..5ae1cf1 100644
--- a/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
+++ b/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
@@ -75,7 +75,10 @@ namespace {
void emitFrameDirective();
void printInstruction(const MachineInstr *MI); // autogenerated.
- void EmitInstruction(const MachineInstr *MI) { printInstruction(MI); }
+ void EmitInstruction(const MachineInstr *MI) {
+ printInstruction(MI);
+ O << '\n';
+ }
virtual void EmitFunctionBodyStart();
virtual void EmitFunctionBodyEnd();
static const char *getRegisterName(unsigned RegNo);
diff --git a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
index 241bb90..17581a9 100644
--- a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
@@ -555,6 +555,7 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
O << ", ";
printOperand(MI, 1);
O << ", " << (unsigned int)SH;
+ O << '\n';
return;
}
}
@@ -565,6 +566,7 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
printOperand(MI, 0);
O << ", ";
printOperand(MI, 1);
+ O << '\n';
return;
}
@@ -578,11 +580,13 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
O << ", ";
printOperand(MI, 1);
O << ", " << (unsigned int)SH;
+ O << '\n';
return;
}
}
printInstruction(MI);
+ O << '\n';
}
void PPCLinuxAsmPrinter::EmitFunctionEntryLabel() {
diff --git a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
index 950daa9..7f529fe 100644
--- a/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
+++ b/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
@@ -44,6 +44,7 @@ namespace {
virtual void EmitInstruction(const MachineInstr *MI) {
printInstruction(MI);
+ O << '\n';
}
void printInstruction(const MachineInstr *MI); // autogenerated.
static const char *getRegisterName(unsigned RegNo);
diff --git a/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp b/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp
index 1611ae8..965f5a1 100644
--- a/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp
+++ b/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp
@@ -79,6 +79,7 @@ namespace {
void SystemZAsmPrinter::EmitInstruction(const MachineInstr *MI) {
// Call the autogenerated instruction printer routines.
printInstruction(MI);
+ O << '\n';
}
void SystemZAsmPrinter::printPCRelImmOperand(const MachineInstr *MI, int OpNum){
diff --git a/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp b/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
index b45e671..3b3b9ff 100644
--- a/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
+++ b/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
@@ -448,6 +448,7 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
}
O << "+";
printOperand(MI, NOps-2);
+ O << '\n';
return;
}
case X86::MOVPC32r: {
@@ -475,6 +476,7 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
TmpInst.setOpcode(X86::POP32r);
TmpInst.getOperand(0) = MCOperand::CreateReg(MI->getOperand(0).getReg());
printMCInst(&TmpInst);
+ O << '\n';
return;
}
@@ -512,6 +514,7 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
TmpInst.addOperand(MCOperand::CreateReg(MI->getOperand(1).getReg()));
TmpInst.addOperand(MCOperand::CreateExpr(DotExpr));
printMCInst(&TmpInst);
+ O << '\n';
return;
}
}
@@ -521,5 +524,6 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
printMCInst(&TmpInst);
+ O << '\n';
}
diff --git a/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp b/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
index f85217c..b9ba61e 100644
--- a/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
+++ b/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
@@ -309,6 +309,7 @@ void XCoreAsmPrinter::EmitInstruction(const MachineInstr *MI) {
return;
}
printInstruction(MI);
+ O << '\n';
}
// Force static initialization.