mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
print all the newlines at the end of instructions with
OutStreamer.AddBlankLine instead of textually. llvm-svn: 95734
This commit is contained in:
parent
d9026b3fa4
commit
6d7856867a
@ -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 {
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -58,7 +58,7 @@ namespace {
|
||||
|
||||
void EmitInstruction(const MachineInstr *MI) {
|
||||
printInstruction(MI);
|
||||
O << '\n';
|
||||
OutStreamer.AddBlankLine();
|
||||
}
|
||||
void printOp(const MachineOperand &MO);
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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) {
|
||||
|
@ -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() {
|
||||
|
@ -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);
|
||||
|
@ -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){
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user