mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-30 15:22:41 +00:00
replace printBasicBlockLabel with EmitBasicBlockStart,
now that printBasicBlockLabel is only used for starting a MBB. This allows elimination of a bunch of arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81684 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4afcedfad1
commit
70a54c07a0
@ -350,12 +350,11 @@ namespace llvm {
|
|||||||
/// block label.
|
/// block label.
|
||||||
MCSymbol *GetMBBSymbol(unsigned MBBID) const;
|
MCSymbol *GetMBBSymbol(unsigned MBBID) const;
|
||||||
|
|
||||||
/// printBasicBlockLabel - This method prints the label for the specified
|
/// EmitBasicBlockStart - This method prints the label for the specified
|
||||||
/// MachineBasicBlock
|
/// MachineBasicBlock, an alignment (if present) and a comment describing
|
||||||
void printBasicBlockLabel(const MachineBasicBlock *MBB,
|
/// it if appropriate.
|
||||||
bool printAlign = false,
|
void EmitBasicBlockStart(const MachineBasicBlock *MBB,
|
||||||
bool printColon = false,
|
bool printColon = true) const;
|
||||||
bool printComment = true) const;
|
|
||||||
protected:
|
protected:
|
||||||
/// EmitZeros - Emit a block of zeros.
|
/// EmitZeros - Emit a block of zeros.
|
||||||
///
|
///
|
||||||
|
@ -1644,22 +1644,20 @@ MCSymbol *AsmPrinter::GetMBBSymbol(unsigned MBBID) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// printBasicBlockLabel - This method prints the label for the specified
|
/// EmitBasicBlockStart - This method prints the label for the specified
|
||||||
/// MachineBasicBlock
|
/// MachineBasicBlock, an alignment (if present) and a comment describing
|
||||||
void AsmPrinter::printBasicBlockLabel(const MachineBasicBlock *MBB,
|
/// it if appropriate.
|
||||||
bool printAlign, bool printColon,
|
void AsmPrinter::EmitBasicBlockStart(const MachineBasicBlock *MBB,
|
||||||
bool printComment) const {
|
bool PrintColon) const {
|
||||||
if (printAlign) {
|
if (unsigned Align = MBB->getAlignment())
|
||||||
unsigned Align = MBB->getAlignment();
|
|
||||||
if (Align)
|
|
||||||
EmitAlignment(Log2_32(Align));
|
EmitAlignment(Log2_32(Align));
|
||||||
}
|
|
||||||
|
|
||||||
GetMBBSymbol(MBB->getNumber())->print(O, MAI);
|
GetMBBSymbol(MBB->getNumber())->print(O, MAI);
|
||||||
|
|
||||||
if (printColon)
|
if (PrintColon)
|
||||||
O << ':';
|
O << ':';
|
||||||
if (printComment) {
|
|
||||||
|
if (VerboseAsm) {
|
||||||
if (const BasicBlock *BB = MBB->getBasicBlock())
|
if (const BasicBlock *BB = MBB->getBasicBlock())
|
||||||
if (BB->hasName()) {
|
if (BB->hasName()) {
|
||||||
O.PadToColumn(MAI->getCommentColumn());
|
O.PadToColumn(MAI->getCommentColumn());
|
||||||
@ -1667,7 +1665,6 @@ void AsmPrinter::printBasicBlockLabel(const MachineBasicBlock *MBB,
|
|||||||
WriteAsOperand(O, BB, /*PrintType=*/false);
|
WriteAsOperand(O, BB, /*PrintType=*/false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (printColon)
|
|
||||||
EmitComments(*MBB);
|
EmitComments(*MBB);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -282,7 +282,7 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
// Print a label for the basic block.
|
// Print a label for the basic block.
|
||||||
if (I != MF.begin()) {
|
if (I != MF.begin()) {
|
||||||
printBasicBlockLabel(I, true, true, VerboseAsm);
|
EmitBasicBlockStart(I);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
}
|
}
|
||||||
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
|
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
|
||||||
|
@ -170,7 +170,7 @@ bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
|
for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
|
||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
if (I != MF.begin()) {
|
if (I != MF.begin()) {
|
||||||
printBasicBlockLabel(I, true, true);
|
EmitBasicBlockStart(I);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
}
|
}
|
||||||
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
|
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
|
||||||
|
@ -137,7 +137,7 @@ bool BlackfinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
// This is an entry block or a block that's only reachable via a
|
// 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.
|
// fallthrough edge. In non-VerboseAsm mode, don't print the label.
|
||||||
} else {
|
} else {
|
||||||
printBasicBlockLabel(I, true, true, VerboseAsm);
|
EmitBasicBlockStart(I);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -463,7 +463,7 @@ bool LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
// Print a label for the basic block.
|
// Print a label for the basic block.
|
||||||
if (I != MF.begin()) {
|
if (I != MF.begin()) {
|
||||||
printBasicBlockLabel(I, true, true);
|
EmitBasicBlockStart(I);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
}
|
}
|
||||||
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
|
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
|
||||||
|
@ -126,7 +126,7 @@ bool MSP430AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
// This is an entry block or a block that's only reachable via a
|
// 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.
|
// fallthrough edge. In non-VerboseAsm mode, don't print the label.
|
||||||
} else {
|
} else {
|
||||||
printBasicBlockLabel(I, true, true, VerboseAsm);
|
EmitBasicBlockStart(I);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@ bool MipsAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
|
|
||||||
// Print a label for the basic block.
|
// Print a label for the basic block.
|
||||||
if (I != MF.begin()) {
|
if (I != MF.begin()) {
|
||||||
printBasicBlockLabel(I, true, true);
|
EmitBasicBlockStart(I);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
|
|
||||||
// Print a label for the basic block.
|
// Print a label for the basic block.
|
||||||
if (I != MF.begin()) {
|
if (I != MF.begin()) {
|
||||||
printBasicBlockLabel(I, true);
|
EmitBasicBlockStart(I, false);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -670,7 +670,7 @@ bool PPCLinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
// Print a label for the basic block.
|
// Print a label for the basic block.
|
||||||
if (I != MF.begin()) {
|
if (I != MF.begin()) {
|
||||||
printBasicBlockLabel(I, true, true);
|
EmitBasicBlockStart(I);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
}
|
}
|
||||||
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
|
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
|
||||||
@ -854,7 +854,7 @@ bool PPCDarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
// Print a label for the basic block.
|
// Print a label for the basic block.
|
||||||
if (I != MF.begin()) {
|
if (I != MF.begin()) {
|
||||||
printBasicBlockLabel(I, true, true, VerboseAsm);
|
EmitBasicBlockStart(I);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
}
|
}
|
||||||
for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
|
for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
|
||||||
|
@ -122,7 +122,7 @@ bool SparcAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
// Print a label for the basic block.
|
// Print a label for the basic block.
|
||||||
if (I != MF.begin()) {
|
if (I != MF.begin()) {
|
||||||
printBasicBlockLabel(I, true, true);
|
EmitBasicBlockStart(I);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
}
|
}
|
||||||
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
|
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
|
||||||
|
@ -131,7 +131,7 @@ bool SystemZAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
// This is an entry block or a block that's only reachable via a
|
// 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.
|
// fallthrough edge. In non-VerboseAsm mode, don't print the label.
|
||||||
} else {
|
} else {
|
||||||
printBasicBlockLabel(I, true, true, VerboseAsm);
|
EmitBasicBlockStart(I);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
// This is an entry block or a block that's only reachable via a
|
// 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.
|
// fallthrough edge. In non-VerboseAsm mode, don't print the label.
|
||||||
} else {
|
} else {
|
||||||
printBasicBlockLabel(I, true, true, VerboseAsm);
|
EmitBasicBlockStart(I);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
}
|
}
|
||||||
for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
|
for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
|
||||||
|
@ -170,7 +170,7 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
// Print a label for the basic block if there are any predecessors.
|
// Print a label for the basic block if there are any predecessors.
|
||||||
if (!I->pred_empty()) {
|
if (!I->pred_empty()) {
|
||||||
printBasicBlockLabel(I, true, true);
|
EmitBasicBlockStart(I);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
}
|
}
|
||||||
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
|
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
|
||||||
|
@ -273,7 +273,7 @@ bool XCoreAsmPrinter::runOnMachineFunction(MachineFunction &MF)
|
|||||||
|
|
||||||
// Print a label for the basic block.
|
// Print a label for the basic block.
|
||||||
if (I != MF.begin()) {
|
if (I != MF.begin()) {
|
||||||
printBasicBlockLabel(I, true , true);
|
EmitBasicBlockStart(I);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user