mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-27 22:15:18 +00:00
convert some uses of printBasicBlockLabel to use GetMBBSymbol
instead. llvm-svn: 81677
This commit is contained in:
parent
42e63360c7
commit
de1324146e
@ -416,12 +416,12 @@ void AsmPrinter::printPICJumpTableEntry(const MachineJumpTableInfo *MJTI,
|
||||
// If we're emitting non-PIC code, then emit the entries as direct
|
||||
// references to the target basic blocks.
|
||||
if (!isPIC) {
|
||||
printBasicBlockLabel(MBB, false, false, false);
|
||||
GetMBBSymbol(MBB->getNumber())->print(O, MAI);
|
||||
} else if (MAI->getSetDirective()) {
|
||||
O << MAI->getPrivateGlobalPrefix() << getFunctionNumber()
|
||||
<< '_' << uid << "_set_" << MBB->getNumber();
|
||||
} else {
|
||||
printBasicBlockLabel(MBB, false, false, false);
|
||||
GetMBBSymbol(MBB->getNumber())->print(O, MAI);
|
||||
// If the arch uses custom Jump Table directives, don't calc relative to
|
||||
// JT
|
||||
if (!HadJTEntryDirective)
|
||||
@ -1571,8 +1571,8 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const {
|
||||
++OpNo; // Skip over the ID number.
|
||||
|
||||
if (Modifier[0]=='l') // labels are target independent
|
||||
printBasicBlockLabel(MI->getOperand(OpNo).getMBB(),
|
||||
false, false, false);
|
||||
GetMBBSymbol(MI->getOperand(OpNo).getMBB()
|
||||
->getNumber())->print(O, MAI);
|
||||
else {
|
||||
AsmPrinter *AP = const_cast<AsmPrinter*>(this);
|
||||
if ((OpFlags & 7) == 4) {
|
||||
@ -1647,8 +1647,7 @@ 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 printAlign, bool printColon,
|
||||
bool printComment) const {
|
||||
if (printAlign) {
|
||||
unsigned Align = MBB->getAlignment();
|
||||
@ -1682,7 +1681,7 @@ void AsmPrinter::printPICJumpTableSetLabel(unsigned uid,
|
||||
|
||||
O << MAI->getSetDirective() << ' ' << MAI->getPrivateGlobalPrefix()
|
||||
<< getFunctionNumber() << '_' << uid << "_set_" << MBB->getNumber() << ',';
|
||||
printBasicBlockLabel(MBB, false, false, false);
|
||||
GetMBBSymbol(MBB->getNumber())->print(O, MAI);
|
||||
O << '-' << MAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
|
||||
<< '_' << uid << '\n';
|
||||
}
|
||||
@ -1695,7 +1694,7 @@ void AsmPrinter::printPICJumpTableSetLabel(unsigned uid, unsigned uid2,
|
||||
O << MAI->getSetDirective() << ' ' << MAI->getPrivateGlobalPrefix()
|
||||
<< getFunctionNumber() << '_' << uid << '_' << uid2
|
||||
<< "_set_" << MBB->getNumber() << ',';
|
||||
printBasicBlockLabel(MBB, false, false, false);
|
||||
GetMBBSymbol(MBB->getNumber())->print(O, MAI);
|
||||
O << '-' << MAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
|
||||
<< '_' << uid << '_' << uid2 << '\n';
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "llvm/MC/MCSectionMachO.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/Target/TargetData.h"
|
||||
#include "llvm/Target/TargetLoweringObjectFile.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
@ -330,7 +331,7 @@ void ARMAsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
|
||||
break;
|
||||
}
|
||||
case MachineOperand::MO_MachineBasicBlock:
|
||||
printBasicBlockLabel(MO.getMBB());
|
||||
GetMBBSymbol(MO.getMBB()->getNumber())->print(O, MAI);
|
||||
return;
|
||||
case MachineOperand::MO_GlobalAddress: {
|
||||
bool isCallOp = Modifier && !strcmp(Modifier, "call");
|
||||
@ -893,11 +894,11 @@ void ARMAsmPrinter::printJTBlockOperand(const MachineInstr *MI, int OpNum) {
|
||||
<< '_' << JTI << '_' << MO2.getImm()
|
||||
<< "_set_" << MBB->getNumber();
|
||||
else if (TM.getRelocationModel() == Reloc::PIC_) {
|
||||
printBasicBlockLabel(MBB, false, false, false);
|
||||
GetMBBSymbol(MBB->getNumber())->print(O, MAI);
|
||||
O << '-' << MAI->getPrivateGlobalPrefix() << "JTI"
|
||||
<< getFunctionNumber() << '_' << JTI << '_' << MO2.getImm();
|
||||
} else {
|
||||
printBasicBlockLabel(MBB, false, false, false);
|
||||
GetMBBSymbol(MBB->getNumber())->print(O, MAI);
|
||||
}
|
||||
if (i != e-1)
|
||||
O << '\n';
|
||||
@ -929,12 +930,12 @@ void ARMAsmPrinter::printJT2BlockOperand(const MachineInstr *MI, int OpNum) {
|
||||
O << MAI->getData16bitsDirective();
|
||||
if (ByteOffset || HalfWordOffset) {
|
||||
O << '(';
|
||||
printBasicBlockLabel(MBB, false, false, false);
|
||||
GetMBBSymbol(MBB->getNumber())->print(O, MAI);
|
||||
O << "-" << MAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
|
||||
<< '_' << JTI << '_' << MO2.getImm() << ")/2";
|
||||
} else {
|
||||
O << "\tb.w ";
|
||||
printBasicBlockLabel(MBB, false, false, false);
|
||||
GetMBBSymbol(MBB->getNumber())->print(O, MAI);
|
||||
}
|
||||
if (i != e-1)
|
||||
O << '\n';
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "llvm/CodeGen/DwarfWriter.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/Target/TargetLoweringObjectFile.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Target/TargetRegistry.h"
|
||||
@ -95,7 +96,7 @@ void AlphaAsmPrinter::printOp(const MachineOperand &MO, bool IsCallOp) {
|
||||
return;
|
||||
|
||||
case MachineOperand::MO_MachineBasicBlock:
|
||||
printBasicBlockLabel(MO.getMBB());
|
||||
GetMBBSymbol(MO.getMBB()->getNumber())->print(O, MAI);
|
||||
return;
|
||||
|
||||
case MachineOperand::MO_ConstantPoolIndex:
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "llvm/CodeGen/MachineInstr.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/Target/TargetData.h"
|
||||
#include "llvm/Target/TargetLoweringObjectFile.h"
|
||||
#include "llvm/Target/TargetRegistry.h"
|
||||
@ -176,7 +177,7 @@ void BlackfinAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
|
||||
O << MO.getImm();
|
||||
break;
|
||||
case MachineOperand::MO_MachineBasicBlock:
|
||||
printBasicBlockLabel(MO.getMBB(), false, false, false);
|
||||
GetMBBSymbol(MO.getMBB()->getNumber())->print(O, MAI);
|
||||
return;
|
||||
case MachineOperand::MO_GlobalAddress:
|
||||
O << Mang->getMangledName(MO.getGlobal());
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "llvm/CodeGen/MachineInstr.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/Target/TargetLoweringObjectFile.h"
|
||||
#include "llvm/Target/TargetInstrInfo.h"
|
||||
#include "llvm/Target/TargetOptions.h"
|
||||
@ -322,7 +323,7 @@ void SPUAsmPrinter::printOp(const MachineOperand &MO) {
|
||||
return;
|
||||
|
||||
case MachineOperand::MO_MachineBasicBlock:
|
||||
printBasicBlockLabel(MO.getMBB());
|
||||
GetMBBSymbol(MO.getMBB()->getNumber())->print(O, MAI);
|
||||
return;
|
||||
case MachineOperand::MO_JumpTableIndex:
|
||||
O << MAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "llvm/CodeGen/MachineConstantPool.h"
|
||||
#include "llvm/CodeGen/MachineInstr.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/Target/TargetData.h"
|
||||
#include "llvm/Target/TargetLoweringObjectFile.h"
|
||||
#include "llvm/Target/TargetRegistry.h"
|
||||
@ -170,7 +171,7 @@ void MSP430AsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
|
||||
O << MO.getImm();
|
||||
return;
|
||||
case MachineOperand::MO_MachineBasicBlock:
|
||||
printBasicBlockLabel(MO.getMBB());
|
||||
GetMBBSymbol(MO.getMBB()->getNumber())->print(O, MAI);
|
||||
return;
|
||||
case MachineOperand::MO_GlobalAddress: {
|
||||
bool isMemOp = Modifier && !strcmp(Modifier, "mem");
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "llvm/CodeGen/MachineInstr.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/Target/TargetData.h"
|
||||
#include "llvm/Target/TargetLoweringObjectFile.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
@ -348,7 +349,7 @@ void MipsAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
|
||||
break;
|
||||
|
||||
case MachineOperand::MO_MachineBasicBlock:
|
||||
printBasicBlockLabel(MO.getMBB());
|
||||
GetMBBSymbol(MO.getMBB()->getNumber())->print(O, MAI);
|
||||
return;
|
||||
|
||||
case MachineOperand::MO_GlobalAddress:
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "llvm/CodeGen/DwarfWriter.h"
|
||||
#include "llvm/CodeGen/MachineModuleInfo.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/Target/TargetRegistry.h"
|
||||
#include "llvm/Target/TargetLoweringObjectFile.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
@ -171,7 +172,7 @@ void PIC16AsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
|
||||
break;
|
||||
}
|
||||
case MachineOperand::MO_MachineBasicBlock:
|
||||
printBasicBlockLabel(MO.getMBB());
|
||||
GetMBBSymbol(MO.getMBB()->getNumber())->print(O, MAI);
|
||||
return;
|
||||
|
||||
default:
|
||||
|
@ -31,9 +31,10 @@
|
||||
#include "llvm/CodeGen/MachineFunctionPass.h"
|
||||
#include "llvm/CodeGen/MachineInstr.h"
|
||||
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCSectionMachO.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/Target/TargetLoweringObjectFile.h"
|
||||
#include "llvm/Target/TargetRegisterInfo.h"
|
||||
#include "llvm/Target/TargetInstrInfo.h"
|
||||
@ -403,7 +404,7 @@ void PPCAsmPrinter::printOp(const MachineOperand &MO) {
|
||||
llvm_unreachable("printOp() does not handle immediate values");
|
||||
|
||||
case MachineOperand::MO_MachineBasicBlock:
|
||||
printBasicBlockLabel(MO.getMBB());
|
||||
GetMBBSymbol(MO.getMBB()->getNumber())->print(O, MAI);
|
||||
return;
|
||||
case MachineOperand::MO_JumpTableIndex:
|
||||
O << MAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
|
||||
|
@ -24,8 +24,9 @@
|
||||
#include "llvm/CodeGen/MachineFunctionPass.h"
|
||||
#include "llvm/CodeGen/MachineConstantPool.h"
|
||||
#include "llvm/CodeGen/MachineInstr.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/Target/TargetLoweringObjectFile.h"
|
||||
#include "llvm/Target/TargetRegistry.h"
|
||||
#include "llvm/ADT/Statistic.h"
|
||||
@ -169,7 +170,7 @@ void SparcAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
|
||||
O << (int)MO.getImm();
|
||||
break;
|
||||
case MachineOperand::MO_MachineBasicBlock:
|
||||
printBasicBlockLabel(MO.getMBB());
|
||||
GetMBBSymbol(MO.getMBB()->getNumber())->print(O, MAI);
|
||||
return;
|
||||
case MachineOperand::MO_GlobalAddress:
|
||||
O << Mang->getMangledName(MO.getGlobal());
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "llvm/CodeGen/MachineInstr.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/Target/TargetData.h"
|
||||
#include "llvm/Target/TargetLoweringObjectFile.h"
|
||||
#include "llvm/Target/TargetRegistry.h"
|
||||
@ -163,14 +164,14 @@ void SystemZAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
||||
O << '\n';
|
||||
}
|
||||
|
||||
void SystemZAsmPrinter::printPCRelImmOperand(const MachineInstr *MI, int OpNum) {
|
||||
void SystemZAsmPrinter::printPCRelImmOperand(const MachineInstr *MI, int OpNum){
|
||||
const MachineOperand &MO = MI->getOperand(OpNum);
|
||||
switch (MO.getType()) {
|
||||
case MachineOperand::MO_Immediate:
|
||||
O << MO.getImm();
|
||||
return;
|
||||
case MachineOperand::MO_MachineBasicBlock:
|
||||
printBasicBlockLabel(MO.getMBB(), false, false, VerboseAsm);
|
||||
GetMBBSymbol(MO.getMBB()->getNumber())->print(O, MAI);
|
||||
return;
|
||||
case MachineOperand::MO_GlobalAddress: {
|
||||
const GlobalValue *GV = MO.getGlobal();
|
||||
@ -227,7 +228,7 @@ void SystemZAsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
|
||||
O << MO.getImm();
|
||||
return;
|
||||
case MachineOperand::MO_MachineBasicBlock:
|
||||
printBasicBlockLabel(MO.getMBB());
|
||||
GetMBBSymbol(MO.getMBB()->getNumber())->print(O, MAI);
|
||||
return;
|
||||
case MachineOperand::MO_JumpTableIndex:
|
||||
O << MAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber() << '_'
|
||||
|
@ -424,7 +424,7 @@ void X86ATTAsmPrinter::print_pcrel_imm(const MachineInstr *MI, unsigned OpNo) {
|
||||
O << MO.getImm();
|
||||
return;
|
||||
case MachineOperand::MO_MachineBasicBlock:
|
||||
printBasicBlockLabel(MO.getMBB(), false, false, false);
|
||||
GetMBBSymbol(MO.getMBB()->getNumber())->print(O, MAI);
|
||||
return;
|
||||
case MachineOperand::MO_GlobalAddress:
|
||||
case MachineOperand::MO_ExternalSymbol:
|
||||
@ -550,7 +550,9 @@ void X86ATTAsmPrinter::printPICJumpTableSetLabel(unsigned uid,
|
||||
|
||||
O << MAI->getSetDirective() << ' ' << MAI->getPrivateGlobalPrefix()
|
||||
<< getFunctionNumber() << '_' << uid << "_set_" << MBB->getNumber() << ',';
|
||||
printBasicBlockLabel(MBB, false, false, false);
|
||||
|
||||
GetMBBSymbol(MBB->getNumber())->print(O, MAI);
|
||||
|
||||
if (Subtarget->isPICStyleRIPRel())
|
||||
O << '-' << MAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
|
||||
<< '_' << uid << '\n';
|
||||
@ -581,10 +583,10 @@ void X86ATTAsmPrinter::printPICJumpTableEntry(const MachineJumpTableInfo *MJTI,
|
||||
O << MAI->getPrivateGlobalPrefix() << getFunctionNumber()
|
||||
<< '_' << uid << "_set_" << MBB->getNumber();
|
||||
} else if (Subtarget->isPICStyleGOT()) {
|
||||
printBasicBlockLabel(MBB, false, false, false);
|
||||
GetMBBSymbol(MBB->getNumber())->print(O, MAI);
|
||||
O << "@GOTOFF";
|
||||
} else
|
||||
printBasicBlockLabel(MBB, false, false, false);
|
||||
GetMBBSymbol(MBB->getNumber())->print(O, MAI);
|
||||
}
|
||||
|
||||
bool X86ATTAsmPrinter::printAsmMRegister(const MachineOperand &MO, char Mode) {
|
||||
|
@ -26,8 +26,9 @@
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/Assembly/Writer.h"
|
||||
#include "llvm/CodeGen/DwarfWriter.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/Target/TargetLoweringObjectFile.h"
|
||||
#include "llvm/Target/TargetOptions.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
@ -274,7 +275,7 @@ void X86IntelAsmPrinter::print_pcrel_imm(const MachineInstr *MI, unsigned OpNo){
|
||||
O << MO.getImm();
|
||||
return;
|
||||
case MachineOperand::MO_MachineBasicBlock:
|
||||
printBasicBlockLabel(MO.getMBB(), false, false, false);
|
||||
GetMBBSymbol(MO.getMBB()->getNumber())->print(O, MAI);
|
||||
return;
|
||||
|
||||
case MachineOperand::MO_GlobalAddress: {
|
||||
@ -362,7 +363,7 @@ void X86IntelAsmPrinter::printPICJumpTableSetLabel(unsigned uid,
|
||||
|
||||
O << MAI->getSetDirective() << ' ' << MAI->getPrivateGlobalPrefix()
|
||||
<< getFunctionNumber() << '_' << uid << "_set_" << MBB->getNumber() << ',';
|
||||
printBasicBlockLabel(MBB, false, false, false);
|
||||
GetMBBSymbol(MBB->getNumber())->print(O, MAI);
|
||||
O << '-' << "\"L" << getFunctionNumber() << "$pb\"'\n";
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "llvm/CodeGen/MachineConstantPool.h"
|
||||
#include "llvm/CodeGen/MachineInstr.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/Target/TargetData.h"
|
||||
#include "llvm/Target/TargetLoweringObjectFile.h"
|
||||
#include "llvm/Target/TargetRegistry.h"
|
||||
@ -318,7 +319,7 @@ void XCoreAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
|
||||
O << MO.getImm();
|
||||
break;
|
||||
case MachineOperand::MO_MachineBasicBlock:
|
||||
printBasicBlockLabel(MO.getMBB());
|
||||
GetMBBSymbol(MO.getMBB()->getNumber())->print(O, MAI);
|
||||
break;
|
||||
case MachineOperand::MO_GlobalAddress:
|
||||
O << Mang->getMangledName(MO.getGlobal());
|
||||
|
Loading…
Reference in New Issue
Block a user