mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-26 23:29:22 +00:00
add a new MachineBasicBlock::getSymbol method, replacing
the AsmPrinter::GetMBBSymbol. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94515 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
030c4bfbc9
commit
f71cb015c1
@ -301,10 +301,6 @@ namespace llvm {
|
|||||||
/// ExternalSymbol.
|
/// ExternalSymbol.
|
||||||
MCSymbol *GetExternalSymbolSymbol(StringRef Sym) const;
|
MCSymbol *GetExternalSymbolSymbol(StringRef Sym) const;
|
||||||
|
|
||||||
/// GetMBBSymbol - Return the MCSymbol corresponding to the specified basic
|
|
||||||
/// block label.
|
|
||||||
MCSymbol *GetMBBSymbol(unsigned MBBID) const;
|
|
||||||
|
|
||||||
/// GetCPISymbol - Return the symbol for the specified constant pool entry.
|
/// GetCPISymbol - Return the symbol for the specified constant pool entry.
|
||||||
MCSymbol *GetCPISymbol(unsigned CPID) const;
|
MCSymbol *GetCPISymbol(unsigned CPID) const;
|
||||||
|
|
||||||
|
@ -352,6 +352,10 @@ public:
|
|||||||
int getNumber() const { return Number; }
|
int getNumber() const { return Number; }
|
||||||
void setNumber(int N) { Number = N; }
|
void setNumber(int N) { Number = N; }
|
||||||
|
|
||||||
|
/// getSymbol - Return the MCSymbol for this basic block.
|
||||||
|
///
|
||||||
|
MCSymbol *getSymbol(MCContext &Ctx) const;
|
||||||
|
|
||||||
private: // Methods used to maintain doubly linked list of blocks...
|
private: // Methods used to maintain doubly linked list of blocks...
|
||||||
friend struct ilist_traits<MachineBasicBlock>;
|
friend struct ilist_traits<MachineBasicBlock>;
|
||||||
|
|
||||||
|
@ -534,7 +534,7 @@ void AsmPrinter::EmitJumpTableInfo(MachineFunction &MF) {
|
|||||||
// In non-pic mode, the entries in the jump table are direct references
|
// In non-pic mode, the entries in the jump table are direct references
|
||||||
// to the basic blocks.
|
// to the basic blocks.
|
||||||
for (unsigned ii = 0, ee = JTBBs.size(); ii != ee; ++ii) {
|
for (unsigned ii = 0, ee = JTBBs.size(); ii != ee; ++ii) {
|
||||||
MCSymbol *MBBSym = GetMBBSymbol(JTBBs[ii]->getNumber());
|
MCSymbol *MBBSym = JTBBs[ii]->getSymbol(OutContext);
|
||||||
OutStreamer.EmitValue(MCSymbolRefExpr::Create(MBBSym, OutContext),
|
OutStreamer.EmitValue(MCSymbolRefExpr::Create(MBBSym, OutContext),
|
||||||
EntrySize, /*addrspace*/0);
|
EntrySize, /*addrspace*/0);
|
||||||
}
|
}
|
||||||
@ -557,13 +557,13 @@ void AsmPrinter::printPICJumpTableEntry(const MachineJumpTableInfo *MJTI,
|
|||||||
case MachineJumpTableInfo::EK_BlockAddress:
|
case MachineJumpTableInfo::EK_BlockAddress:
|
||||||
// EK_BlockAddress - Each entry is a plain address of block, e.g.:
|
// EK_BlockAddress - Each entry is a plain address of block, e.g.:
|
||||||
// .word LBB123
|
// .word LBB123
|
||||||
Value = MCSymbolRefExpr::Create(GetMBBSymbol(MBB->getNumber()), OutContext);
|
Value = MCSymbolRefExpr::Create(MBB->getSymbol(OutContext), OutContext);
|
||||||
break;
|
break;
|
||||||
case MachineJumpTableInfo::EK_GPRel32BlockAddress: {
|
case MachineJumpTableInfo::EK_GPRel32BlockAddress: {
|
||||||
// EK_GPRel32BlockAddress - Each entry is an address of block, encoded
|
// EK_GPRel32BlockAddress - Each entry is an address of block, encoded
|
||||||
// with a relocation as gp-relative, e.g.:
|
// with a relocation as gp-relative, e.g.:
|
||||||
// .gprel32 LBB123
|
// .gprel32 LBB123
|
||||||
MCSymbol *MBBSym = GetMBBSymbol(MBB->getNumber());
|
MCSymbol *MBBSym = MBB->getSymbol(OutContext);
|
||||||
OutStreamer.EmitGPRel32Value(MCSymbolRefExpr::Create(MBBSym, OutContext));
|
OutStreamer.EmitGPRel32Value(MCSymbolRefExpr::Create(MBBSym, OutContext));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -587,7 +587,7 @@ void AsmPrinter::printPICJumpTableEntry(const MachineJumpTableInfo *MJTI,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Otherwise, use the difference as the jump table entry.
|
// Otherwise, use the difference as the jump table entry.
|
||||||
Value = MCSymbolRefExpr::Create(GetMBBSymbol(MBB->getNumber()), OutContext);
|
Value = MCSymbolRefExpr::Create(MBB->getSymbol(OutContext), OutContext);
|
||||||
const MCExpr *JTI = MCSymbolRefExpr::Create(GetJTISymbol(uid), OutContext);
|
const MCExpr *JTI = MCSymbolRefExpr::Create(GetJTISymbol(uid), OutContext);
|
||||||
Value = MCBinaryExpr::CreateSub(Value, JTI, OutContext);
|
Value = MCBinaryExpr::CreateSub(Value, JTI, OutContext);
|
||||||
break;
|
break;
|
||||||
@ -1286,7 +1286,7 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const {
|
|||||||
++OpNo; // Skip over the ID number.
|
++OpNo; // Skip over the ID number.
|
||||||
|
|
||||||
if (Modifier[0] == 'l') // labels are target independent
|
if (Modifier[0] == 'l') // labels are target independent
|
||||||
O << *GetMBBSymbol(MI->getOperand(OpNo).getMBB()->getNumber());
|
O << *MI->getOperand(OpNo).getMBB()->getSymbol(OutContext);
|
||||||
else {
|
else {
|
||||||
AsmPrinter *AP = const_cast<AsmPrinter*>(this);
|
AsmPrinter *AP = const_cast<AsmPrinter*>(this);
|
||||||
if ((OpFlags & 7) == 4) {
|
if ((OpFlags & 7) == 4) {
|
||||||
@ -1386,13 +1386,6 @@ MCSymbol *AsmPrinter::GetBlockAddressSymbol(const Function *F,
|
|||||||
return OutContext.GetOrCreateSymbol(NameResult.str());
|
return OutContext.GetOrCreateSymbol(NameResult.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
MCSymbol *AsmPrinter::GetMBBSymbol(unsigned MBBID) const {
|
|
||||||
SmallString<60> Name;
|
|
||||||
raw_svector_ostream(Name) << MAI->getPrivateGlobalPrefix() << "BB"
|
|
||||||
<< getFunctionNumber() << '_' << MBBID;
|
|
||||||
return OutContext.GetOrCreateSymbol(Name.str());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// GetCPISymbol - Return the symbol for the specified constant pool entry.
|
/// GetCPISymbol - Return the symbol for the specified constant pool entry.
|
||||||
MCSymbol *AsmPrinter::GetCPISymbol(unsigned CPID) const {
|
MCSymbol *AsmPrinter::GetCPISymbol(unsigned CPID) const {
|
||||||
SmallString<60> Name;
|
SmallString<60> Name;
|
||||||
@ -1555,7 +1548,7 @@ void AsmPrinter::EmitBasicBlockStart(const MachineBasicBlock *MBB) const {
|
|||||||
PrintBasicBlockLoopComments(*MBB, LI, *this);
|
PrintBasicBlockLoopComments(*MBB, LI, *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
OutStreamer.EmitLabel(GetMBBSymbol(MBB->getNumber()));
|
OutStreamer.EmitLabel(MBB->getSymbol(OutContext));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1568,7 +1561,7 @@ void AsmPrinter::printPICJumpTableSetLabel(unsigned uid,
|
|||||||
|
|
||||||
O << MAI->getSetDirective() << ' ' << MAI->getPrivateGlobalPrefix()
|
O << MAI->getSetDirective() << ' ' << MAI->getPrivateGlobalPrefix()
|
||||||
<< *GetJTSetSymbol(uid, MBB->getNumber()) << ','
|
<< *GetJTSetSymbol(uid, MBB->getNumber()) << ','
|
||||||
<< *GetMBBSymbol(MBB->getNumber()) << '-' << *GetJTISymbol(uid) << '\n';
|
<< *MBB->getSymbol(OutContext) << '-' << *GetJTISymbol(uid) << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
void AsmPrinter::printVisibility(MCSymbol *Sym, unsigned Visibility) const {
|
void AsmPrinter::printVisibility(MCSymbol *Sym, unsigned Visibility) const {
|
||||||
|
@ -14,15 +14,18 @@
|
|||||||
#include "llvm/CodeGen/MachineBasicBlock.h"
|
#include "llvm/CodeGen/MachineBasicBlock.h"
|
||||||
#include "llvm/BasicBlock.h"
|
#include "llvm/BasicBlock.h"
|
||||||
#include "llvm/CodeGen/MachineFunction.h"
|
#include "llvm/CodeGen/MachineFunction.h"
|
||||||
|
#include "llvm/MC/MCAsmInfo.h"
|
||||||
|
#include "llvm/MC/MCContext.h"
|
||||||
#include "llvm/Target/TargetRegisterInfo.h"
|
#include "llvm/Target/TargetRegisterInfo.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "llvm/Target/TargetInstrDesc.h"
|
#include "llvm/Target/TargetInstrDesc.h"
|
||||||
#include "llvm/Target/TargetInstrInfo.h"
|
#include "llvm/Target/TargetInstrInfo.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
|
#include "llvm/Assembly/Writer.h"
|
||||||
|
#include "llvm/ADT/SmallString.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
#include "llvm/Support/LeakDetector.h"
|
#include "llvm/Support/LeakDetector.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
#include "llvm/Assembly/Writer.h"
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
@ -36,6 +39,18 @@ MachineBasicBlock::~MachineBasicBlock() {
|
|||||||
LeakDetector::removeGarbageObject(this);
|
LeakDetector::removeGarbageObject(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// getSymbol - Return the MCSymbol for this basic block.
|
||||||
|
///
|
||||||
|
MCSymbol *MachineBasicBlock::getSymbol(MCContext &Ctx) const {
|
||||||
|
SmallString<60> Name;
|
||||||
|
const MachineFunction *MF = getParent();
|
||||||
|
raw_svector_ostream(Name)
|
||||||
|
<< MF->getTarget().getMCAsmInfo()->getPrivateGlobalPrefix() << "BB"
|
||||||
|
<< MF->getFunctionNumber() << '_' << getNumber();
|
||||||
|
return Ctx.GetOrCreateSymbol(Name.str());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
raw_ostream &llvm::operator<<(raw_ostream &OS, const MachineBasicBlock &MBB) {
|
raw_ostream &llvm::operator<<(raw_ostream &OS, const MachineBasicBlock &MBB) {
|
||||||
MBB.print(OS);
|
MBB.print(OS);
|
||||||
return OS;
|
return OS;
|
||||||
|
@ -369,7 +369,7 @@ void ARMAsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MachineOperand::MO_MachineBasicBlock:
|
case MachineOperand::MO_MachineBasicBlock:
|
||||||
O << *GetMBBSymbol(MO.getMBB()->getNumber());
|
O << *MO.getMBB()->getSymbol(OutContext);
|
||||||
return;
|
return;
|
||||||
case MachineOperand::MO_GlobalAddress: {
|
case MachineOperand::MO_GlobalAddress: {
|
||||||
bool isCallOp = Modifier && !strcmp(Modifier, "call");
|
bool isCallOp = Modifier && !strcmp(Modifier, "call");
|
||||||
@ -948,16 +948,16 @@ void ARMAsmPrinter::printJTBlockOperand(const MachineInstr *MI, int OpNum) {
|
|||||||
if (UseSet && isNew) {
|
if (UseSet && isNew) {
|
||||||
O << MAI->getSetDirective() << ' '
|
O << MAI->getSetDirective() << ' '
|
||||||
<< *GetARMSetPICJumpTableLabel2(JTI, MO2.getImm(), MBB) << ','
|
<< *GetARMSetPICJumpTableLabel2(JTI, MO2.getImm(), MBB) << ','
|
||||||
<< *GetMBBSymbol(MBB->getNumber()) << '-' << *JTISymbol << '\n';
|
<< *MBB->getSymbol(OutContext) << '-' << *JTISymbol << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
O << JTEntryDirective << ' ';
|
O << JTEntryDirective << ' ';
|
||||||
if (UseSet)
|
if (UseSet)
|
||||||
O << *GetARMSetPICJumpTableLabel2(JTI, MO2.getImm(), MBB);
|
O << *GetARMSetPICJumpTableLabel2(JTI, MO2.getImm(), MBB);
|
||||||
else if (TM.getRelocationModel() == Reloc::PIC_)
|
else if (TM.getRelocationModel() == Reloc::PIC_)
|
||||||
O << *GetMBBSymbol(MBB->getNumber()) << '-' << *JTISymbol;
|
O << *MBB->getSymbol(OutContext) << '-' << *JTISymbol;
|
||||||
else
|
else
|
||||||
O << *GetMBBSymbol(MBB->getNumber());
|
O << *MBB->getSymbol(OutContext);
|
||||||
|
|
||||||
if (i != e-1)
|
if (i != e-1)
|
||||||
O << '\n';
|
O << '\n';
|
||||||
@ -989,9 +989,9 @@ void ARMAsmPrinter::printJT2BlockOperand(const MachineInstr *MI, int OpNum) {
|
|||||||
O << MAI->getData16bitsDirective();
|
O << MAI->getData16bitsDirective();
|
||||||
|
|
||||||
if (ByteOffset || HalfWordOffset)
|
if (ByteOffset || HalfWordOffset)
|
||||||
O << '(' << *GetMBBSymbol(MBB->getNumber()) << "-" << *JTISymbol << ")/2";
|
O << '(' << *MBB->getSymbol(OutContext) << "-" << *JTISymbol << ")/2";
|
||||||
else
|
else
|
||||||
O << "\tb.w " << *GetMBBSymbol(MBB->getNumber());
|
O << "\tb.w " << *MBB->getSymbol(OutContext);
|
||||||
|
|
||||||
if (i != e-1)
|
if (i != e-1)
|
||||||
O << '\n';
|
O << '\n';
|
||||||
|
@ -135,7 +135,7 @@ void ARMMCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
|
|||||||
break;
|
break;
|
||||||
case MachineOperand::MO_MachineBasicBlock:
|
case MachineOperand::MO_MachineBasicBlock:
|
||||||
MCOp = MCOperand::CreateExpr(MCSymbolRefExpr::Create(
|
MCOp = MCOperand::CreateExpr(MCSymbolRefExpr::Create(
|
||||||
Printer.GetMBBSymbol(MO.getMBB()->getNumber()), Ctx));
|
MO.getMBB()->getSymbol(Ctx), Ctx));
|
||||||
break;
|
break;
|
||||||
case MachineOperand::MO_GlobalAddress:
|
case MachineOperand::MO_GlobalAddress:
|
||||||
MCOp = LowerSymbolOperand(MO, GetGlobalAddressSymbol(MO));
|
MCOp = LowerSymbolOperand(MO, GetGlobalAddressSymbol(MO));
|
||||||
|
@ -93,7 +93,7 @@ void AlphaAsmPrinter::printOp(const MachineOperand &MO, bool IsCallOp) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
case MachineOperand::MO_MachineBasicBlock:
|
case MachineOperand::MO_MachineBasicBlock:
|
||||||
O << *GetMBBSymbol(MO.getMBB()->getNumber());
|
O << *MO.getMBB()->getSymbol(OutContext);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case MachineOperand::MO_ConstantPoolIndex:
|
case MachineOperand::MO_ConstantPoolIndex:
|
||||||
|
@ -152,7 +152,7 @@ void BlackfinAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
|
|||||||
O << MO.getImm();
|
O << MO.getImm();
|
||||||
break;
|
break;
|
||||||
case MachineOperand::MO_MachineBasicBlock:
|
case MachineOperand::MO_MachineBasicBlock:
|
||||||
O << *GetMBBSymbol(MO.getMBB()->getNumber());
|
O << *MO.getMBB()->getSymbol(OutContext);
|
||||||
return;
|
return;
|
||||||
case MachineOperand::MO_GlobalAddress:
|
case MachineOperand::MO_GlobalAddress:
|
||||||
O << *GetGlobalValueSymbol(MO.getGlobal());
|
O << *GetGlobalValueSymbol(MO.getGlobal());
|
||||||
|
@ -312,7 +312,7 @@ void SPUAsmPrinter::printOp(const MachineOperand &MO) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
case MachineOperand::MO_MachineBasicBlock:
|
case MachineOperand::MO_MachineBasicBlock:
|
||||||
O << *GetMBBSymbol(MO.getMBB()->getNumber());
|
O << *MO.getMBB()->getSymbol(OutContext);
|
||||||
return;
|
return;
|
||||||
case MachineOperand::MO_JumpTableIndex:
|
case MachineOperand::MO_JumpTableIndex:
|
||||||
O << MAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
|
O << MAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
|
||||||
|
@ -173,7 +173,7 @@ void MSP430AsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
|
|||||||
O << MO.getImm();
|
O << MO.getImm();
|
||||||
return;
|
return;
|
||||||
case MachineOperand::MO_MachineBasicBlock:
|
case MachineOperand::MO_MachineBasicBlock:
|
||||||
O << *GetMBBSymbol(MO.getMBB()->getNumber());
|
O << *MO.getMBB()->getSymbol(OutContext);
|
||||||
return;
|
return;
|
||||||
case MachineOperand::MO_GlobalAddress: {
|
case MachineOperand::MO_GlobalAddress: {
|
||||||
bool isMemOp = Modifier && !strcmp(Modifier, "mem");
|
bool isMemOp = Modifier && !strcmp(Modifier, "mem");
|
||||||
|
@ -116,7 +116,7 @@ void MSP430MCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
|
|||||||
break;
|
break;
|
||||||
case MachineOperand::MO_MachineBasicBlock:
|
case MachineOperand::MO_MachineBasicBlock:
|
||||||
MCOp = MCOperand::CreateExpr(MCSymbolRefExpr::Create(
|
MCOp = MCOperand::CreateExpr(MCSymbolRefExpr::Create(
|
||||||
Printer.GetMBBSymbol(MO.getMBB()->getNumber()), Ctx));
|
MO.getMBB()->getSymbol(Printer.OutContext), Ctx));
|
||||||
break;
|
break;
|
||||||
case MachineOperand::MO_GlobalAddress:
|
case MachineOperand::MO_GlobalAddress:
|
||||||
MCOp = LowerSymbolOperand(MO, GetGlobalAddressSymbol(MO));
|
MCOp = LowerSymbolOperand(MO, GetGlobalAddressSymbol(MO));
|
||||||
|
@ -341,7 +341,7 @@ void MipsAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MachineOperand::MO_MachineBasicBlock:
|
case MachineOperand::MO_MachineBasicBlock:
|
||||||
O << *GetMBBSymbol(MO.getMBB()->getNumber());
|
O << *MO.getMBB()->getSymbol(OutContext);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case MachineOperand::MO_GlobalAddress:
|
case MachineOperand::MO_GlobalAddress:
|
||||||
|
@ -209,7 +209,7 @@ void PIC16AsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MachineOperand::MO_MachineBasicBlock:
|
case MachineOperand::MO_MachineBasicBlock:
|
||||||
O << *GetMBBSymbol(MO.getMBB()->getNumber());
|
O << *MO.getMBB()->getSymbol(OutContext);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -382,7 +382,7 @@ void PPCAsmPrinter::printOp(const MachineOperand &MO) {
|
|||||||
llvm_unreachable("printOp() does not handle immediate values");
|
llvm_unreachable("printOp() does not handle immediate values");
|
||||||
|
|
||||||
case MachineOperand::MO_MachineBasicBlock:
|
case MachineOperand::MO_MachineBasicBlock:
|
||||||
O << *GetMBBSymbol(MO.getMBB()->getNumber());
|
O << *MO.getMBB()->getSymbol(OutContext);
|
||||||
return;
|
return;
|
||||||
case MachineOperand::MO_JumpTableIndex:
|
case MachineOperand::MO_JumpTableIndex:
|
||||||
O << MAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
|
O << MAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
|
||||||
|
@ -191,7 +191,7 @@ void SparcAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
|
|||||||
O << (int)MO.getImm();
|
O << (int)MO.getImm();
|
||||||
break;
|
break;
|
||||||
case MachineOperand::MO_MachineBasicBlock:
|
case MachineOperand::MO_MachineBasicBlock:
|
||||||
O << *GetMBBSymbol(MO.getMBB()->getNumber());
|
O << *MO.getMBB()->getSymbol(OutContext);
|
||||||
return;
|
return;
|
||||||
case MachineOperand::MO_GlobalAddress:
|
case MachineOperand::MO_GlobalAddress:
|
||||||
O << *GetGlobalValueSymbol(MO.getGlobal());
|
O << *GetGlobalValueSymbol(MO.getGlobal());
|
||||||
|
@ -166,7 +166,7 @@ void SystemZAsmPrinter::printPCRelImmOperand(const MachineInstr *MI, int OpNum){
|
|||||||
O << MO.getImm();
|
O << MO.getImm();
|
||||||
return;
|
return;
|
||||||
case MachineOperand::MO_MachineBasicBlock:
|
case MachineOperand::MO_MachineBasicBlock:
|
||||||
O << *GetMBBSymbol(MO.getMBB()->getNumber());
|
O << *MO.getMBB()->getSymbol(OutContext);
|
||||||
return;
|
return;
|
||||||
case MachineOperand::MO_GlobalAddress: {
|
case MachineOperand::MO_GlobalAddress: {
|
||||||
const GlobalValue *GV = MO.getGlobal();
|
const GlobalValue *GV = MO.getGlobal();
|
||||||
@ -221,7 +221,7 @@ void SystemZAsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
|
|||||||
O << MO.getImm();
|
O << MO.getImm();
|
||||||
return;
|
return;
|
||||||
case MachineOperand::MO_MachineBasicBlock:
|
case MachineOperand::MO_MachineBasicBlock:
|
||||||
O << *GetMBBSymbol(MO.getMBB()->getNumber());
|
O << *MO.getMBB()->getSymbol(OutContext);
|
||||||
return;
|
return;
|
||||||
case MachineOperand::MO_JumpTableIndex:
|
case MachineOperand::MO_JumpTableIndex:
|
||||||
O << MAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber() << '_'
|
O << MAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber() << '_'
|
||||||
|
@ -340,7 +340,7 @@ void X86AsmPrinter::print_pcrel_imm(const MachineInstr *MI, unsigned OpNo) {
|
|||||||
O << MO.getImm();
|
O << MO.getImm();
|
||||||
return;
|
return;
|
||||||
case MachineOperand::MO_MachineBasicBlock:
|
case MachineOperand::MO_MachineBasicBlock:
|
||||||
O << *GetMBBSymbol(MO.getMBB()->getNumber());
|
O << *MO.getMBB()->getSymbol(OutContext);
|
||||||
return;
|
return;
|
||||||
case MachineOperand::MO_GlobalAddress:
|
case MachineOperand::MO_GlobalAddress:
|
||||||
case MachineOperand::MO_ExternalSymbol:
|
case MachineOperand::MO_ExternalSymbol:
|
||||||
@ -465,7 +465,7 @@ void X86AsmPrinter::printPICJumpTableSetLabel(unsigned uid,
|
|||||||
O << MAI->getSetDirective() << ' ' << MAI->getPrivateGlobalPrefix()
|
O << MAI->getSetDirective() << ' ' << MAI->getPrivateGlobalPrefix()
|
||||||
<< getFunctionNumber() << '_' << uid << "_set_" << MBB->getNumber() << ',';
|
<< getFunctionNumber() << '_' << uid << "_set_" << MBB->getNumber() << ',';
|
||||||
|
|
||||||
O << *GetMBBSymbol(MBB->getNumber());
|
O << *MBB->getSymbol(OutContext);
|
||||||
|
|
||||||
if (Subtarget->isPICStyleRIPRel())
|
if (Subtarget->isPICStyleRIPRel())
|
||||||
O << '-' << *GetJTISymbol(uid) << '\n';
|
O << '-' << *GetJTISymbol(uid) << '\n';
|
||||||
@ -495,9 +495,9 @@ void X86AsmPrinter::printPICJumpTableEntry(const MachineJumpTableInfo *MJTI,
|
|||||||
if (Subtarget->isPICStyleRIPRel() || Subtarget->isPICStyleStubPIC()) {
|
if (Subtarget->isPICStyleRIPRel() || Subtarget->isPICStyleStubPIC()) {
|
||||||
O << *GetJTSetSymbol(uid, MBB->getNumber());
|
O << *GetJTSetSymbol(uid, MBB->getNumber());
|
||||||
} else if (Subtarget->isPICStyleGOT())
|
} else if (Subtarget->isPICStyleGOT())
|
||||||
O << *GetMBBSymbol(MBB->getNumber()) << "@GOTOFF";
|
O << *MBB->getSymbol(OutContext) << "@GOTOFF";
|
||||||
else // mdynamic-no-pic
|
else // mdynamic-no-pic
|
||||||
O << *GetMBBSymbol(MBB->getNumber());
|
O << *MBB->getSymbol(OutContext);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@ void X86MCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
|
|||||||
break;
|
break;
|
||||||
case MachineOperand::MO_MachineBasicBlock:
|
case MachineOperand::MO_MachineBasicBlock:
|
||||||
MCOp = MCOperand::CreateExpr(MCSymbolRefExpr::Create(
|
MCOp = MCOperand::CreateExpr(MCSymbolRefExpr::Create(
|
||||||
AsmPrinter.GetMBBSymbol(MO.getMBB()->getNumber()), Ctx));
|
MO.getMBB()->getSymbol(Ctx), Ctx));
|
||||||
break;
|
break;
|
||||||
case MachineOperand::MO_GlobalAddress:
|
case MachineOperand::MO_GlobalAddress:
|
||||||
MCOp = LowerSymbolOperand(MO, GetGlobalAddressSymbol(MO));
|
MCOp = LowerSymbolOperand(MO, GetGlobalAddressSymbol(MO));
|
||||||
|
@ -297,7 +297,7 @@ void XCoreAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
|
|||||||
O << MO.getImm();
|
O << MO.getImm();
|
||||||
break;
|
break;
|
||||||
case MachineOperand::MO_MachineBasicBlock:
|
case MachineOperand::MO_MachineBasicBlock:
|
||||||
O << *GetMBBSymbol(MO.getMBB()->getNumber());
|
O << *MO.getMBB()->getSymbol(OutContext);
|
||||||
break;
|
break;
|
||||||
case MachineOperand::MO_GlobalAddress:
|
case MachineOperand::MO_GlobalAddress:
|
||||||
O << *GetGlobalValueSymbol(MO.getGlobal());
|
O << *GetGlobalValueSymbol(MO.getGlobal());
|
||||||
|
Loading…
Reference in New Issue
Block a user