summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-10 00:36:00 +0000
committerChris Lattner <sabre@nondot.org>2010-02-10 00:36:00 +0000
commitff68a42121f71774bc318a416314afda110e8004 (patch)
tree64ee4bb4c6226487be1450f3c9309849f6ed306f
parent113b8ad7cfd570eb26ce107c626e224254965f94 (diff)
downloadbcm5719-llvm-ff68a42121f71774bc318a416314afda110e8004.tar.gz
bcm5719-llvm-ff68a42121f71774bc318a416314afda110e8004.zip
print all the newlines at the end of instructions with
OutStreamer.AddBlankLine instead of textually. llvm-svn: 95734
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp10
-rw-r--r--llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp6
-rw-r--r--llvm/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp2
-rw-r--r--llvm/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp2
-rw-r--r--llvm/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp2
-rw-r--r--llvm/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp2
-rw-r--r--llvm/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp2
-rw-r--r--llvm/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp8
-rw-r--r--llvm/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp3
-rw-r--r--llvm/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp2
-rw-r--r--llvm/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp6
-rw-r--r--llvm/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp5
12 files changed, 27 insertions, 23 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 570916f7b78..25e0818404b 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1442,7 +1442,8 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const {
}
}
}
- O << "\n\t" << MAI->getCommentString() << MAI->getInlineAsmEnd() << '\n';
+ O << "\n\t" << MAI->getCommentString() << MAI->getInlineAsmEnd();
+ OutStreamer.AddBlankLine();
}
/// printImplicitDef - This method prints the specified machine instruction
@@ -1451,7 +1452,8 @@ void AsmPrinter::printImplicitDef(const MachineInstr *MI) const {
if (!VerboseAsm) return;
O.PadToColumn(MAI->getCommentColumn());
O << MAI->getCommentString() << " implicit-def: "
- << TRI->getName(MI->getOperand(0).getReg()) << '\n';
+ << TRI->getName(MI->getOperand(0).getReg());
+ OutStreamer.AddBlankLine();
}
void AsmPrinter::printKill(const MachineInstr *MI) const {
@@ -1463,14 +1465,14 @@ void AsmPrinter::printKill(const MachineInstr *MI) const {
assert(op.isReg() && "KILL instruction must have only register operands");
O << ' ' << TRI->getName(op.getReg()) << (op.isDef() ? "<def>" : "<kill>");
}
- O << '\n';
+ OutStreamer.AddBlankLine();
}
/// printLabel - This method prints a local label used by debug and
/// exception handling tables.
void AsmPrinter::printLabelInst(const MachineInstr *MI) const {
printLabel(MI->getOperand(0).getImm());
- O << '\n';
+ OutStreamer.AddBlankLine();
}
void AsmPrinter::printLabel(unsigned Id) const {
diff --git a/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
index d456123b112..0a75c092e29 100644
--- a/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
+++ b/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
@@ -220,7 +220,7 @@ namespace {
O << "-.";
O << ')';
}
- O << '\n';
+ OutStreamer.AddBlankLine();
}
void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -819,7 +819,7 @@ void ARMAsmPrinter::printCPInstOperand(const MachineInstr *MI, int OpNum,
// data itself.
if (!strcmp(Modifier, "label")) {
unsigned ID = MI->getOperand(OpNum).getImm();
- O << *GetCPISymbol(ID) << ":\n";
+ OutStreamer.EmitLabel(GetCPISymbol(ID));
} else {
assert(!strcmp(Modifier, "cpentry") && "Unknown modifier for CPE");
unsigned CPI = MI->getOperand(OpNum).getIndex();
@@ -1030,7 +1030,7 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
EmitAlignment(2);
printInstruction(MI);
- O << '\n';
+ OutStreamer.AddBlankLine();
}
}
diff --git a/llvm/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp b/llvm/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
index 03a49b27349..733a46c0ad2 100644
--- a/llvm/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
+++ b/llvm/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
@@ -47,7 +47,7 @@ namespace {
void printInstruction(const MachineInstr *MI);
void EmitInstruction(const MachineInstr *MI) {
printInstruction(MI);
- O << '\n';
+ OutStreamer.AddBlankLine();
}
static const char *getRegisterName(unsigned RegNo);
diff --git a/llvm/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp b/llvm/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp
index 885e69701c4..fe13e14844c 100644
--- a/llvm/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp
+++ b/llvm/lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp
@@ -54,7 +54,7 @@ namespace {
void EmitInstruction(const MachineInstr *MI) {
printInstruction(MI);
- O << '\n';
+ OutStreamer.AddBlankLine();
}
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
unsigned AsmVariant, const char *ExtraCode);
diff --git a/llvm/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp b/llvm/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
index db653a733ca..2ca05c24f20 100644
--- a/llvm/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
+++ b/llvm/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
@@ -58,7 +58,7 @@ namespace {
void EmitInstruction(const MachineInstr *MI) {
printInstruction(MI);
- O << '\n';
+ OutStreamer.AddBlankLine();
}
void printOp(const MachineOperand &MO);
diff --git a/llvm/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp b/llvm/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
index 5ae1cf10af2..b8641c30976 100644
--- a/llvm/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
+++ b/llvm/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
@@ -77,7 +77,7 @@ namespace {
void printInstruction(const MachineInstr *MI); // autogenerated.
void EmitInstruction(const MachineInstr *MI) {
printInstruction(MI);
- O << '\n';
+ OutStreamer.AddBlankLine();
}
virtual void EmitFunctionBodyStart();
virtual void EmitFunctionBodyEnd();
diff --git a/llvm/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp b/llvm/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp
index 0a27827311d..72f7c16c637 100644
--- a/llvm/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp
+++ b/llvm/lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp
@@ -45,7 +45,7 @@ PIC16AsmPrinter::PIC16AsmPrinter(formatted_raw_ostream &O, TargetMachine &TM,
void PIC16AsmPrinter::EmitInstruction(const MachineInstr *MI) {
printInstruction(MI);
- O << '\n';
+ OutStreamer.AddBlankLine();
}
static int getFunctionColor(const Function *F) {
diff --git a/llvm/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
index bf2e693e89d..afc90b1aecb 100644
--- a/llvm/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
@@ -555,7 +555,7 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
O << ", ";
printOperand(MI, 1);
O << ", " << (unsigned int)SH;
- O << '\n';
+ OutStreamer.AddBlankLine();
return;
}
}
@@ -566,7 +566,7 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
printOperand(MI, 0);
O << ", ";
printOperand(MI, 1);
- O << '\n';
+ OutStreamer.AddBlankLine();
return;
}
@@ -580,13 +580,13 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
O << ", ";
printOperand(MI, 1);
O << ", " << (unsigned int)SH;
- O << '\n';
+ OutStreamer.AddBlankLine();
return;
}
}
printInstruction(MI);
- O << '\n';
+ OutStreamer.AddBlankLine();
}
void PPCLinuxAsmPrinter::EmitFunctionEntryLabel() {
diff --git a/llvm/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp b/llvm/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
index e0cafcca7fe..9a2ce6bec17 100644
--- a/llvm/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
+++ b/llvm/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
@@ -19,6 +19,7 @@
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/MC/MCAsmInfo.h"
+#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/ADT/StringExtras.h"
@@ -44,7 +45,7 @@ namespace {
virtual void EmitInstruction(const MachineInstr *MI) {
printInstruction(MI);
- O << '\n';
+ OutStreamer.AddBlankLine();
}
void printInstruction(const MachineInstr *MI); // autogenerated.
static const char *getRegisterName(unsigned RegNo);
diff --git a/llvm/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp b/llvm/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp
index 965f5a18098..7a9e8dd2073 100644
--- a/llvm/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp
+++ b/llvm/lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp
@@ -79,7 +79,7 @@ namespace {
void SystemZAsmPrinter::EmitInstruction(const MachineInstr *MI) {
// Call the autogenerated instruction printer routines.
printInstruction(MI);
- O << '\n';
+ OutStreamer.AddBlankLine();
}
void SystemZAsmPrinter::printPCRelImmOperand(const MachineInstr *MI, int OpNum){
diff --git a/llvm/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp b/llvm/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
index cc9a800f411..fa8d13d6a40 100644
--- a/llvm/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
+++ b/llvm/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
@@ -321,7 +321,8 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
if (MI->getOperand(0).getType()==MachineOperand::MO_Register &&
MI->getOperand(0).getReg()==0) {
// Suppress offset in this case, it is not meaningful.
- O << "undef\n";
+ O << "undef";
+ OutStreamer.AddBlankLine();
return;
} else if (MI->getOperand(0).getType()==MachineOperand::MO_FPImmediate) {
// This is more naturally done in printOperand, but since the only use
@@ -350,7 +351,7 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
}
O << "+";
printOperand(MI, NOps-2);
- O << '\n';
+ OutStreamer.AddBlankLine();
return;
}
case X86::MOVPC32r: {
@@ -421,7 +422,6 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
MCInst TmpInst;
MCInstLowering.Lower(MI, TmpInst);
-
OutStreamer.EmitInstruction(TmpInst);
}
diff --git a/llvm/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp b/llvm/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
index b9ba61e505c..d18f55de81b 100644
--- a/llvm/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
+++ b/llvm/lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp
@@ -305,11 +305,12 @@ void XCoreAsmPrinter::EmitInstruction(const MachineInstr *MI) {
unsigned src, dst, srcSR, dstSR;
if (TM.getInstrInfo()->isMoveInstr(*MI, src, dst, srcSR, dstSR)) {
O << "\tmov " << getRegisterName(dst) << ", ";
- O << getRegisterName(src) << '\n';
+ O << getRegisterName(src);
+ OutStreamer.AddBlankLine();
return;
}
printInstruction(MI);
- O << '\n';
+ OutStreamer.AddBlankLine();
}
// Force static initialization.
OpenPOWER on IntegriCloud