mirror of
https://github.com/RPCSX/llvm.git
synced 2025-04-09 11:41:02 +00:00
* Stop using BBNumbering, we don't really need it
* Only increment labelNumber once, because it's used by both Load{hi,lo}Addr * There is no .bss section on PowerPC * Use .align 2 instead of other random numbers git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14504 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7b00096e33
commit
61297ee118
@ -369,10 +369,6 @@ void Printer::printConstantPool(MachineConstantPool *MCP) {
|
|||||||
/// method to print assembly for each instruction.
|
/// method to print assembly for each instruction.
|
||||||
///
|
///
|
||||||
bool Printer::runOnMachineFunction(MachineFunction &MF) {
|
bool Printer::runOnMachineFunction(MachineFunction &MF) {
|
||||||
// BBNumber is used here so that a given Printer will never give two
|
|
||||||
// BBs the same name. (If you have a better way, please let me know!)
|
|
||||||
static unsigned BBNumber = 0;
|
|
||||||
|
|
||||||
O << "\n\n";
|
O << "\n\n";
|
||||||
// What's my mangled name?
|
// What's my mangled name?
|
||||||
CurrentFnName = Mang->getValueName(MF.getFunction());
|
CurrentFnName = Mang->getValueName(MF.getFunction());
|
||||||
@ -383,7 +379,7 @@ bool Printer::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
// Print out labels for the function.
|
// Print out labels for the function.
|
||||||
O << "\t.text\n";
|
O << "\t.text\n";
|
||||||
O << "\t.globl\t" << CurrentFnName << "\n";
|
O << "\t.globl\t" << CurrentFnName << "\n";
|
||||||
O << "\t.align 5\n";
|
O << "\t.align 2\n";
|
||||||
O << CurrentFnName << ":\n";
|
O << CurrentFnName << ":\n";
|
||||||
|
|
||||||
// Print out code for the function.
|
// Print out code for the function.
|
||||||
@ -523,7 +519,6 @@ void Printer::printMachineInstruction(const MachineInstr *MI) {
|
|||||||
O << "\"L0000" << labelNumber << "$pb\":\n";
|
O << "\"L0000" << labelNumber << "$pb\":\n";
|
||||||
O << "\tmflr ";
|
O << "\tmflr ";
|
||||||
printOp(MI->getOperand(0));
|
printOp(MI->getOperand(0));
|
||||||
labelNumber++;
|
|
||||||
O << "\n";
|
O << "\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -641,10 +636,7 @@ bool Printer::doFinalization(Module &M) {
|
|||||||
O << "\t.globl " << name << "\n";
|
O << "\t.globl " << name << "\n";
|
||||||
// FALL THROUGH
|
// FALL THROUGH
|
||||||
case GlobalValue::InternalLinkage:
|
case GlobalValue::InternalLinkage:
|
||||||
if (C->isNullValue())
|
SwitchSection(O, CurSection, ".data");
|
||||||
SwitchSection(O, CurSection, ".bss");
|
|
||||||
else
|
|
||||||
SwitchSection(O, CurSection, ".data");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -369,10 +369,6 @@ void Printer::printConstantPool(MachineConstantPool *MCP) {
|
|||||||
/// method to print assembly for each instruction.
|
/// method to print assembly for each instruction.
|
||||||
///
|
///
|
||||||
bool Printer::runOnMachineFunction(MachineFunction &MF) {
|
bool Printer::runOnMachineFunction(MachineFunction &MF) {
|
||||||
// BBNumber is used here so that a given Printer will never give two
|
|
||||||
// BBs the same name. (If you have a better way, please let me know!)
|
|
||||||
static unsigned BBNumber = 0;
|
|
||||||
|
|
||||||
O << "\n\n";
|
O << "\n\n";
|
||||||
// What's my mangled name?
|
// What's my mangled name?
|
||||||
CurrentFnName = Mang->getValueName(MF.getFunction());
|
CurrentFnName = Mang->getValueName(MF.getFunction());
|
||||||
@ -383,7 +379,7 @@ bool Printer::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
// Print out labels for the function.
|
// Print out labels for the function.
|
||||||
O << "\t.text\n";
|
O << "\t.text\n";
|
||||||
O << "\t.globl\t" << CurrentFnName << "\n";
|
O << "\t.globl\t" << CurrentFnName << "\n";
|
||||||
O << "\t.align 5\n";
|
O << "\t.align 2\n";
|
||||||
O << CurrentFnName << ":\n";
|
O << CurrentFnName << ":\n";
|
||||||
|
|
||||||
// Print out code for the function.
|
// Print out code for the function.
|
||||||
@ -523,7 +519,6 @@ void Printer::printMachineInstruction(const MachineInstr *MI) {
|
|||||||
O << "\"L0000" << labelNumber << "$pb\":\n";
|
O << "\"L0000" << labelNumber << "$pb\":\n";
|
||||||
O << "\tmflr ";
|
O << "\tmflr ";
|
||||||
printOp(MI->getOperand(0));
|
printOp(MI->getOperand(0));
|
||||||
labelNumber++;
|
|
||||||
O << "\n";
|
O << "\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -641,10 +636,7 @@ bool Printer::doFinalization(Module &M) {
|
|||||||
O << "\t.globl " << name << "\n";
|
O << "\t.globl " << name << "\n";
|
||||||
// FALL THROUGH
|
// FALL THROUGH
|
||||||
case GlobalValue::InternalLinkage:
|
case GlobalValue::InternalLinkage:
|
||||||
if (C->isNullValue())
|
SwitchSection(O, CurSection, ".data");
|
||||||
SwitchSection(O, CurSection, ".bss");
|
|
||||||
else
|
|
||||||
SwitchSection(O, CurSection, ".data");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -369,10 +369,6 @@ void Printer::printConstantPool(MachineConstantPool *MCP) {
|
|||||||
/// method to print assembly for each instruction.
|
/// method to print assembly for each instruction.
|
||||||
///
|
///
|
||||||
bool Printer::runOnMachineFunction(MachineFunction &MF) {
|
bool Printer::runOnMachineFunction(MachineFunction &MF) {
|
||||||
// BBNumber is used here so that a given Printer will never give two
|
|
||||||
// BBs the same name. (If you have a better way, please let me know!)
|
|
||||||
static unsigned BBNumber = 0;
|
|
||||||
|
|
||||||
O << "\n\n";
|
O << "\n\n";
|
||||||
// What's my mangled name?
|
// What's my mangled name?
|
||||||
CurrentFnName = Mang->getValueName(MF.getFunction());
|
CurrentFnName = Mang->getValueName(MF.getFunction());
|
||||||
@ -383,7 +379,7 @@ bool Printer::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
// Print out labels for the function.
|
// Print out labels for the function.
|
||||||
O << "\t.text\n";
|
O << "\t.text\n";
|
||||||
O << "\t.globl\t" << CurrentFnName << "\n";
|
O << "\t.globl\t" << CurrentFnName << "\n";
|
||||||
O << "\t.align 5\n";
|
O << "\t.align 2\n";
|
||||||
O << CurrentFnName << ":\n";
|
O << CurrentFnName << ":\n";
|
||||||
|
|
||||||
// Print out code for the function.
|
// Print out code for the function.
|
||||||
@ -523,7 +519,6 @@ void Printer::printMachineInstruction(const MachineInstr *MI) {
|
|||||||
O << "\"L0000" << labelNumber << "$pb\":\n";
|
O << "\"L0000" << labelNumber << "$pb\":\n";
|
||||||
O << "\tmflr ";
|
O << "\tmflr ";
|
||||||
printOp(MI->getOperand(0));
|
printOp(MI->getOperand(0));
|
||||||
labelNumber++;
|
|
||||||
O << "\n";
|
O << "\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -641,10 +636,7 @@ bool Printer::doFinalization(Module &M) {
|
|||||||
O << "\t.globl " << name << "\n";
|
O << "\t.globl " << name << "\n";
|
||||||
// FALL THROUGH
|
// FALL THROUGH
|
||||||
case GlobalValue::InternalLinkage:
|
case GlobalValue::InternalLinkage:
|
||||||
if (C->isNullValue())
|
SwitchSection(O, CurSection, ".data");
|
||||||
SwitchSection(O, CurSection, ".bss");
|
|
||||||
else
|
|
||||||
SwitchSection(O, CurSection, ".data");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user