1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

replace printBasicBlockLabel with EmitBasicBlockStart,

now that printBasicBlockLabel is only used for starting
a MBB.  This allows elimination of a bunch of arguments.

llvm-svn: 81684
This commit is contained in:
Chris Lattner 2009-09-13 18:25:37 +00:00
parent 89e5731659
commit cbcbedf254
15 changed files with 30 additions and 34 deletions

View File

@ -350,12 +350,11 @@ namespace llvm {
/// block label.
MCSymbol *GetMBBSymbol(unsigned MBBID) const;
/// printBasicBlockLabel - This method prints the label for the specified
/// MachineBasicBlock
void printBasicBlockLabel(const MachineBasicBlock *MBB,
bool printAlign = false,
bool printColon = false,
bool printComment = true) const;
/// EmitBasicBlockStart - This method prints the label for the specified
/// MachineBasicBlock, an alignment (if present) and a comment describing
/// it if appropriate.
void EmitBasicBlockStart(const MachineBasicBlock *MBB,
bool printColon = true) const;
protected:
/// EmitZeros - Emit a block of zeros.
///

View File

@ -1644,22 +1644,20 @@ MCSymbol *AsmPrinter::GetMBBSymbol(unsigned MBBID) const {
}
/// printBasicBlockLabel - This method prints the label for the specified
/// MachineBasicBlock
void AsmPrinter::printBasicBlockLabel(const MachineBasicBlock *MBB,
bool printAlign, bool printColon,
bool printComment) const {
if (printAlign) {
unsigned Align = MBB->getAlignment();
if (Align)
EmitAlignment(Log2_32(Align));
}
/// EmitBasicBlockStart - This method prints the label for the specified
/// MachineBasicBlock, an alignment (if present) and a comment describing
/// it if appropriate.
void AsmPrinter::EmitBasicBlockStart(const MachineBasicBlock *MBB,
bool PrintColon) const {
if (unsigned Align = MBB->getAlignment())
EmitAlignment(Log2_32(Align));
GetMBBSymbol(MBB->getNumber())->print(O, MAI);
if (printColon)
if (PrintColon)
O << ':';
if (printComment) {
if (VerboseAsm) {
if (const BasicBlock *BB = MBB->getBasicBlock())
if (BB->hasName()) {
O.PadToColumn(MAI->getCommentColumn());
@ -1667,8 +1665,7 @@ void AsmPrinter::printBasicBlockLabel(const MachineBasicBlock *MBB,
WriteAsOperand(O, BB, /*PrintType=*/false);
}
if (printColon)
EmitComments(*MBB);
EmitComments(*MBB);
}
}

View File

@ -282,7 +282,7 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
I != E; ++I) {
// Print a label for the basic block.
if (I != MF.begin()) {
printBasicBlockLabel(I, true, true, VerboseAsm);
EmitBasicBlockStart(I);
O << '\n';
}
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();

View File

@ -170,7 +170,7 @@ bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
I != E; ++I) {
if (I != MF.begin()) {
printBasicBlockLabel(I, true, true);
EmitBasicBlockStart(I);
O << '\n';
}
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();

View File

@ -137,7 +137,7 @@ bool BlackfinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
// This is an entry block or a block that's only reachable via a
// fallthrough edge. In non-VerboseAsm mode, don't print the label.
} else {
printBasicBlockLabel(I, true, true, VerboseAsm);
EmitBasicBlockStart(I);
O << '\n';
}

View File

@ -463,7 +463,7 @@ bool LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
I != E; ++I) {
// Print a label for the basic block.
if (I != MF.begin()) {
printBasicBlockLabel(I, true, true);
EmitBasicBlockStart(I);
O << '\n';
}
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();

View File

@ -126,7 +126,7 @@ bool MSP430AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
// This is an entry block or a block that's only reachable via a
// fallthrough edge. In non-VerboseAsm mode, don't print the label.
} else {
printBasicBlockLabel(I, true, true, VerboseAsm);
EmitBasicBlockStart(I);
O << '\n';
}

View File

@ -270,7 +270,7 @@ bool MipsAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
// Print a label for the basic block.
if (I != MF.begin()) {
printBasicBlockLabel(I, true, true);
EmitBasicBlockStart(I);
O << '\n';
}

View File

@ -98,7 +98,7 @@ bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
// Print a label for the basic block.
if (I != MF.begin()) {
printBasicBlockLabel(I, true);
EmitBasicBlockStart(I, false);
O << '\n';
}

View File

@ -670,7 +670,7 @@ bool PPCLinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
I != E; ++I) {
// Print a label for the basic block.
if (I != MF.begin()) {
printBasicBlockLabel(I, true, true);
EmitBasicBlockStart(I);
O << '\n';
}
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
@ -854,7 +854,7 @@ bool PPCDarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
I != E; ++I) {
// Print a label for the basic block.
if (I != MF.begin()) {
printBasicBlockLabel(I, true, true, VerboseAsm);
EmitBasicBlockStart(I);
O << '\n';
}
for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();

View File

@ -122,7 +122,7 @@ bool SparcAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
I != E; ++I) {
// Print a label for the basic block.
if (I != MF.begin()) {
printBasicBlockLabel(I, true, true);
EmitBasicBlockStart(I);
O << '\n';
}
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();

View File

@ -131,7 +131,7 @@ bool SystemZAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
// This is an entry block or a block that's only reachable via a
// fallthrough edge. In non-VerboseAsm mode, don't print the label.
} else {
printBasicBlockLabel(I, true, true, VerboseAsm);
EmitBasicBlockStart(I);
O << '\n';
}

View File

@ -245,7 +245,7 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
// This is an entry block or a block that's only reachable via a
// fallthrough edge. In non-VerboseAsm mode, don't print the label.
} else {
printBasicBlockLabel(I, true, true, VerboseAsm);
EmitBasicBlockStart(I);
O << '\n';
}
for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();

View File

@ -170,7 +170,7 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
I != E; ++I) {
// Print a label for the basic block if there are any predecessors.
if (!I->pred_empty()) {
printBasicBlockLabel(I, true, true);
EmitBasicBlockStart(I);
O << '\n';
}
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();

View File

@ -273,7 +273,7 @@ bool XCoreAsmPrinter::runOnMachineFunction(MachineFunction &MF)
// Print a label for the basic block.
if (I != MF.begin()) {
printBasicBlockLabel(I, true , true);
EmitBasicBlockStart(I);
O << '\n';
}