mirror of
https://github.com/RPCS3/llvm.git
synced 2025-05-13 08:56:04 +00:00
handle the _set_ symbol with an MCSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94449 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
78f485afb7
commit
798d125659
@ -324,6 +324,10 @@ namespace llvm {
|
|||||||
/// GetJTISymbol - Return the symbol for the specified jump table entry.
|
/// GetJTISymbol - Return the symbol for the specified jump table entry.
|
||||||
MCSymbol *GetJTISymbol(unsigned JTID, bool isLinkerPrivate = false) const;
|
MCSymbol *GetJTISymbol(unsigned JTID, bool isLinkerPrivate = false) const;
|
||||||
|
|
||||||
|
/// GetJTSetSymbol - Return the symbol for the specified jump table .set
|
||||||
|
/// FIXME: privatize to AsmPrinter.
|
||||||
|
MCSymbol *GetJTSetSymbol(unsigned UID, unsigned MBBID) const;
|
||||||
|
|
||||||
/// GetBlockAddressSymbol - Return the MCSymbol used to satisfy BlockAddress
|
/// GetBlockAddressSymbol - Return the MCSymbol used to satisfy BlockAddress
|
||||||
/// uses of the specified basic block.
|
/// uses of the specified basic block.
|
||||||
MCSymbol *GetBlockAddressSymbol(const BlockAddress *BA,
|
MCSymbol *GetBlockAddressSymbol(const BlockAddress *BA,
|
||||||
|
@ -557,8 +557,7 @@ void AsmPrinter::printPICJumpTableEntry(const MachineJumpTableInfo *MJTI,
|
|||||||
// If we're emitting non-PIC code, then emit the entries as direct
|
// If we're emitting non-PIC code, then emit the entries as direct
|
||||||
// references to the target basic blocks.
|
// references to the target basic blocks.
|
||||||
if (MAI->getSetDirective()) {
|
if (MAI->getSetDirective()) {
|
||||||
O << MAI->getPrivateGlobalPrefix() << getFunctionNumber()
|
O << *GetJTSetSymbol(uid, MBB->getNumber());
|
||||||
<< '_' << uid << "_set_" << MBB->getNumber();
|
|
||||||
} else {
|
} else {
|
||||||
O << *GetMBBSymbol(MBB->getNumber());
|
O << *GetMBBSymbol(MBB->getNumber());
|
||||||
// If the arch uses custom Jump Table directives, don't calc relative to
|
// If the arch uses custom Jump Table directives, don't calc relative to
|
||||||
@ -1379,6 +1378,15 @@ MCSymbol *AsmPrinter::GetJTISymbol(unsigned JTID, bool isLinkerPrivate) const {
|
|||||||
return OutContext.GetOrCreateSymbol(Name.str());
|
return OutContext.GetOrCreateSymbol(Name.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// GetJTSetSymbol - Return the symbol for the specified jump table .set
|
||||||
|
/// FIXME: privatize to AsmPrinter.
|
||||||
|
MCSymbol *AsmPrinter::GetJTSetSymbol(unsigned UID, unsigned MBBID) const {
|
||||||
|
SmallString<60> Name;
|
||||||
|
raw_svector_ostream(Name) << MAI->getPrivateGlobalPrefix()
|
||||||
|
<< getFunctionNumber() << '_' << UID << "_set_" << MBBID;
|
||||||
|
return OutContext.GetOrCreateSymbol(Name.str());
|
||||||
|
}
|
||||||
|
|
||||||
/// GetGlobalValueSymbol - Return the MCSymbol for the specified global
|
/// GetGlobalValueSymbol - Return the MCSymbol for the specified global
|
||||||
/// value.
|
/// value.
|
||||||
MCSymbol *AsmPrinter::GetGlobalValueSymbol(const GlobalValue *GV) const {
|
MCSymbol *AsmPrinter::GetGlobalValueSymbol(const GlobalValue *GV) const {
|
||||||
@ -1526,9 +1534,8 @@ void AsmPrinter::printPICJumpTableSetLabel(unsigned uid,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
O << MAI->getSetDirective() << ' ' << MAI->getPrivateGlobalPrefix()
|
O << MAI->getSetDirective() << ' ' << MAI->getPrivateGlobalPrefix()
|
||||||
<< getFunctionNumber() << '_' << uid << "_set_" << MBB->getNumber() << ','
|
<< *GetJTSetSymbol(uid, MBB->getNumber()) << ','
|
||||||
<< *GetMBBSymbol(MBB->getNumber())
|
<< *GetMBBSymbol(MBB->getNumber()) << '-' << *GetJTISymbol(uid) << '\n';
|
||||||
<< '-' << *GetJTISymbol(uid) << '\n';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AsmPrinter::printVisibility(MCSymbol *Sym, unsigned Visibility) const {
|
void AsmPrinter::printVisibility(MCSymbol *Sym, unsigned Visibility) const {
|
||||||
|
@ -494,8 +494,7 @@ void X86AsmPrinter::printPICJumpTableEntry(const MachineJumpTableInfo *MJTI,
|
|||||||
O << JTEntryDirective << ' ';
|
O << JTEntryDirective << ' ';
|
||||||
|
|
||||||
if (Subtarget->isPICStyleRIPRel() || Subtarget->isPICStyleStubPIC()) {
|
if (Subtarget->isPICStyleRIPRel() || Subtarget->isPICStyleStubPIC()) {
|
||||||
O << MAI->getPrivateGlobalPrefix() << getFunctionNumber()
|
O << *GetJTSetSymbol(uid, MBB->getNumber());
|
||||||
<< '_' << uid << "_set_" << MBB->getNumber();
|
|
||||||
} else if (Subtarget->isPICStyleGOT())
|
} else if (Subtarget->isPICStyleGOT())
|
||||||
O << *GetMBBSymbol(MBB->getNumber()) << "@GOTOFF";
|
O << *GetMBBSymbol(MBB->getNumber()) << "@GOTOFF";
|
||||||
else // mdynamic-no-pic
|
else // mdynamic-no-pic
|
||||||
|
Loading…
x
Reference in New Issue
Block a user