mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-27 02:31:09 +00:00
move FnStubs/GVSTubs/HiddenGVStub handling out of the X86 asmprinter
and use MachineModuleInfoMachO instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82022 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
29cf5557b2
commit
dc62ea0f1c
@ -76,10 +76,11 @@ namespace llvm {
|
|||||||
///
|
///
|
||||||
MachineLoopInfo *LI;
|
MachineLoopInfo *LI;
|
||||||
|
|
||||||
protected:
|
public:
|
||||||
/// MMI - If available, this is a pointer to the current MachineModuleInfo.
|
/// MMI - If available, this is a pointer to the current MachineModuleInfo.
|
||||||
MachineModuleInfo *MMI;
|
MachineModuleInfo *MMI;
|
||||||
|
|
||||||
|
protected:
|
||||||
/// DW - If available, this is a pointer to the current dwarf writer.
|
/// DW - If available, this is a pointer to the current dwarf writer.
|
||||||
DwarfWriter *DW;
|
DwarfWriter *DW;
|
||||||
|
|
||||||
|
@ -163,17 +163,17 @@ public:
|
|||||||
/// backends that would like to do so.
|
/// backends that would like to do so.
|
||||||
///
|
///
|
||||||
template<typename Ty>
|
template<typename Ty>
|
||||||
Ty *getObjFileInfo() {
|
Ty &getObjFileInfo() {
|
||||||
if (ObjFileMMI == 0)
|
if (ObjFileMMI == 0)
|
||||||
ObjFileMMI = new Ty(*this);
|
ObjFileMMI = new Ty(*this);
|
||||||
|
|
||||||
assert((void*)dynamic_cast<Ty*>(ObjFileMMI) == (void*)ObjFileMMI &&
|
assert((void*)dynamic_cast<Ty*>(ObjFileMMI) == (void*)ObjFileMMI &&
|
||||||
"Invalid concrete type or multiple inheritence for getInfo");
|
"Invalid concrete type or multiple inheritence for getInfo");
|
||||||
return static_cast<Ty*>(ObjFileMMI);
|
return *static_cast<Ty*>(ObjFileMMI);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Ty>
|
template<typename Ty>
|
||||||
const Ty *getObjFileInfo() const {
|
const Ty &getObjFileInfo() const {
|
||||||
return const_cast<MachineModuleInfo*>(this)->getObjFileInfo<Ty>();
|
return const_cast<MachineModuleInfo*>(this)->getObjFileInfo<Ty>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,18 +38,19 @@ namespace llvm {
|
|||||||
|
|
||||||
virtual void Anchor(); // Out of line virtual method.
|
virtual void Anchor(); // Out of line virtual method.
|
||||||
public:
|
public:
|
||||||
|
MachineModuleInfoMachO(const MachineModuleInfo &) {}
|
||||||
|
|
||||||
const MCSymbol *&getFnStubEntry(const MCSymbol *Sym) {
|
const MCSymbol *&getFnStubEntry(const MCSymbol *Sym) {
|
||||||
assert(Sym && "Key cannot be null");
|
assert(Sym && "Key cannot be null");
|
||||||
return FnStubs[Sym];
|
return FnStubs[Sym];
|
||||||
}
|
}
|
||||||
|
|
||||||
const MCSymbol *&getGVStubsEntry(const MCSymbol *Sym) {
|
const MCSymbol *&getGVStubEntry(const MCSymbol *Sym) {
|
||||||
assert(Sym && "Key cannot be null");
|
assert(Sym && "Key cannot be null");
|
||||||
return GVStubs[Sym];
|
return GVStubs[Sym];
|
||||||
}
|
}
|
||||||
|
|
||||||
const MCSymbol *&getHiddenGVStubsEntry(const MCSymbol *Sym) {
|
const MCSymbol *&getHiddenGVStubEntry(const MCSymbol *Sym) {
|
||||||
assert(Sym && "Key cannot be null");
|
assert(Sym && "Key cannot be null");
|
||||||
return HiddenGVStubs[Sym];
|
return HiddenGVStubs[Sym];
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "llvm/MC/MCStreamer.h"
|
#include "llvm/MC/MCStreamer.h"
|
||||||
#include "llvm/MC/MCSymbol.h"
|
#include "llvm/MC/MCSymbol.h"
|
||||||
#include "llvm/CodeGen/MachineJumpTableInfo.h"
|
#include "llvm/CodeGen/MachineJumpTableInfo.h"
|
||||||
|
#include "llvm/CodeGen/MachineModuleInfoImpls.h"
|
||||||
#include "llvm/Support/ErrorHandling.h"
|
#include "llvm/Support/ErrorHandling.h"
|
||||||
#include "llvm/Support/FormattedStream.h"
|
#include "llvm/Support/FormattedStream.h"
|
||||||
#include "llvm/Support/Mangler.h"
|
#include "llvm/Support/Mangler.h"
|
||||||
@ -320,7 +321,9 @@ void X86ATTAsmPrinter::printSymbolOperand(const MachineOperand &MO) {
|
|||||||
Mang->getNameWithPrefix(NameStr, GV, true);
|
Mang->getNameWithPrefix(NameStr, GV, true);
|
||||||
NameStr += "$non_lazy_ptr";
|
NameStr += "$non_lazy_ptr";
|
||||||
MCSymbol *Sym = OutContext.GetOrCreateSymbol(NameStr.str());
|
MCSymbol *Sym = OutContext.GetOrCreateSymbol(NameStr.str());
|
||||||
MCSymbol *&StubSym = GVStubs[Sym];
|
|
||||||
|
const MCSymbol *&StubSym =
|
||||||
|
MMI->getObjFileInfo<MachineModuleInfoMachO>().getGVStubEntry(Sym);
|
||||||
if (StubSym == 0) {
|
if (StubSym == 0) {
|
||||||
NameStr.clear();
|
NameStr.clear();
|
||||||
Mang->getNameWithPrefix(NameStr, GV, false);
|
Mang->getNameWithPrefix(NameStr, GV, false);
|
||||||
@ -331,7 +334,8 @@ void X86ATTAsmPrinter::printSymbolOperand(const MachineOperand &MO) {
|
|||||||
Mang->getNameWithPrefix(NameStr, GV, true);
|
Mang->getNameWithPrefix(NameStr, GV, true);
|
||||||
NameStr += "$non_lazy_ptr";
|
NameStr += "$non_lazy_ptr";
|
||||||
MCSymbol *Sym = OutContext.GetOrCreateSymbol(NameStr.str());
|
MCSymbol *Sym = OutContext.GetOrCreateSymbol(NameStr.str());
|
||||||
MCSymbol *&StubSym = HiddenGVStubs[Sym];
|
const MCSymbol *&StubSym =
|
||||||
|
MMI->getObjFileInfo<MachineModuleInfoMachO>().getHiddenGVStubEntry(Sym);
|
||||||
if (StubSym == 0) {
|
if (StubSym == 0) {
|
||||||
NameStr.clear();
|
NameStr.clear();
|
||||||
Mang->getNameWithPrefix(NameStr, GV, false);
|
Mang->getNameWithPrefix(NameStr, GV, false);
|
||||||
@ -342,7 +346,8 @@ void X86ATTAsmPrinter::printSymbolOperand(const MachineOperand &MO) {
|
|||||||
Mang->getNameWithPrefix(NameStr, GV, true);
|
Mang->getNameWithPrefix(NameStr, GV, true);
|
||||||
NameStr += "$stub";
|
NameStr += "$stub";
|
||||||
MCSymbol *Sym = OutContext.GetOrCreateSymbol(NameStr.str());
|
MCSymbol *Sym = OutContext.GetOrCreateSymbol(NameStr.str());
|
||||||
MCSymbol *&StubSym = FnStubs[Sym];
|
const MCSymbol *&StubSym =
|
||||||
|
MMI->getObjFileInfo<MachineModuleInfoMachO>().getFnStubEntry(Sym);
|
||||||
if (StubSym == 0) {
|
if (StubSym == 0) {
|
||||||
NameStr.clear();
|
NameStr.clear();
|
||||||
Mang->getNameWithPrefix(NameStr, GV, false);
|
Mang->getNameWithPrefix(NameStr, GV, false);
|
||||||
@ -364,7 +369,9 @@ void X86ATTAsmPrinter::printSymbolOperand(const MachineOperand &MO) {
|
|||||||
std::string Name = Mang->makeNameProper(MO.getSymbolName());
|
std::string Name = Mang->makeNameProper(MO.getSymbolName());
|
||||||
if (MO.getTargetFlags() == X86II::MO_DARWIN_STUB) {
|
if (MO.getTargetFlags() == X86II::MO_DARWIN_STUB) {
|
||||||
Name += "$stub";
|
Name += "$stub";
|
||||||
MCSymbol *&StubSym = FnStubs[OutContext.GetOrCreateSymbol(Name)];
|
MCSymbol *Sym = OutContext.GetOrCreateSymbol(Name);
|
||||||
|
const MCSymbol *&StubSym =
|
||||||
|
MMI->getObjFileInfo<MachineModuleInfoMachO>().getFnStubEntry(Sym);
|
||||||
if (StubSym == 0) {
|
if (StubSym == 0) {
|
||||||
Name.erase(Name.end()-5, Name.end());
|
Name.erase(Name.end()-5, Name.end());
|
||||||
StubSym = OutContext.GetOrCreateSymbol(Name);
|
StubSym = OutContext.GetOrCreateSymbol(Name);
|
||||||
@ -872,28 +879,15 @@ void X86ATTAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) {
|
|||||||
O << "\t.size\t" << name << ", " << Size << '\n';
|
O << "\t.size\t" << name << ", " << Size << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
static int SortSymbolPair(const void *LHS, const void *RHS) {
|
|
||||||
MCSymbol *LHSS = ((const std::pair<MCSymbol*, MCSymbol*>*)LHS)->first;
|
|
||||||
MCSymbol *RHSS = ((const std::pair<MCSymbol*, MCSymbol*>*)RHS)->first;
|
|
||||||
return LHSS->getName().compare(RHSS->getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// GetSortedStubs - Return the entries from a DenseMap in a deterministic
|
|
||||||
/// sorted orer.
|
|
||||||
static std::vector<std::pair<MCSymbol*, MCSymbol*> >
|
|
||||||
GetSortedStubs(const DenseMap<MCSymbol*, MCSymbol*> &Map) {
|
|
||||||
assert(!Map.empty());
|
|
||||||
std::vector<std::pair<MCSymbol*, MCSymbol*> > List(Map.begin(), Map.end());
|
|
||||||
qsort(&List[0], List.size(), sizeof(List[0]), SortSymbolPair);
|
|
||||||
return List;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool X86ATTAsmPrinter::doFinalization(Module &M) {
|
bool X86ATTAsmPrinter::doFinalization(Module &M) {
|
||||||
if (Subtarget->isTargetDarwin()) {
|
if (Subtarget->isTargetDarwin()) {
|
||||||
// All darwin targets use mach-o.
|
// All darwin targets use mach-o.
|
||||||
TargetLoweringObjectFileMachO &TLOFMacho =
|
TargetLoweringObjectFileMachO &TLOFMacho =
|
||||||
static_cast<TargetLoweringObjectFileMachO &>(getObjFileLowering());
|
static_cast<TargetLoweringObjectFileMachO &>(getObjFileLowering());
|
||||||
|
|
||||||
|
MachineModuleInfoMachO &MMIMacho =
|
||||||
|
MMI->getObjFileInfo<MachineModuleInfoMachO>();
|
||||||
|
|
||||||
// Add the (possibly multiple) personalities to the set of global value
|
// Add the (possibly multiple) personalities to the set of global value
|
||||||
// stubs. Only referenced functions get into the Personalities list.
|
// stubs. Only referenced functions get into the Personalities list.
|
||||||
if (!Subtarget->is64Bit()) {
|
if (!Subtarget->is64Bit()) {
|
||||||
@ -907,18 +901,18 @@ bool X86ATTAsmPrinter::doFinalization(Module &M) {
|
|||||||
Name += "$non_lazy_ptr";
|
Name += "$non_lazy_ptr";
|
||||||
MCSymbol *NLPName = OutContext.GetOrCreateSymbol(Name.str());
|
MCSymbol *NLPName = OutContext.GetOrCreateSymbol(Name.str());
|
||||||
|
|
||||||
MCSymbol *&StubName = GVStubs[NLPName];
|
const MCSymbol *&StubName = MMIMacho.getGVStubEntry(NLPName);
|
||||||
if (StubName != 0) continue;
|
|
||||||
|
|
||||||
|
|
||||||
Name.clear();
|
Name.clear();
|
||||||
Mang->getNameWithPrefix(Name, Personalities[i], false);
|
Mang->getNameWithPrefix(Name, Personalities[i], false);
|
||||||
StubName = OutContext.GetOrCreateSymbol(Name.str());
|
StubName = OutContext.GetOrCreateSymbol(Name.str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output stubs for dynamically-linked functions
|
// Output stubs for dynamically-linked functions.
|
||||||
if (!FnStubs.empty()) {
|
MachineModuleInfoMachO::SymbolListTy Stubs;
|
||||||
|
|
||||||
|
Stubs = MMIMacho.GetFnStubList();
|
||||||
|
if (!Stubs.empty()) {
|
||||||
const MCSection *TheSection =
|
const MCSection *TheSection =
|
||||||
TLOFMacho.getMachOSection("__IMPORT", "__jump_table",
|
TLOFMacho.getMachOSection("__IMPORT", "__jump_table",
|
||||||
MCSectionMachO::S_SYMBOL_STUBS |
|
MCSectionMachO::S_SYMBOL_STUBS |
|
||||||
@ -927,8 +921,6 @@ bool X86ATTAsmPrinter::doFinalization(Module &M) {
|
|||||||
5, SectionKind::getMetadata());
|
5, SectionKind::getMetadata());
|
||||||
OutStreamer.SwitchSection(TheSection);
|
OutStreamer.SwitchSection(TheSection);
|
||||||
|
|
||||||
std::vector<std::pair<MCSymbol*, MCSymbol*> > Stubs
|
|
||||||
= GetSortedStubs(FnStubs);
|
|
||||||
for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
|
for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
|
||||||
Stubs[i].first->print(O, MAI);
|
Stubs[i].first->print(O, MAI);
|
||||||
O << ":\n" << "\t.indirect_symbol ";
|
O << ":\n" << "\t.indirect_symbol ";
|
||||||
@ -937,38 +929,40 @@ bool X86ATTAsmPrinter::doFinalization(Module &M) {
|
|||||||
O << "\n\thlt ; hlt ; hlt ; hlt ; hlt\n";
|
O << "\n\thlt ; hlt ; hlt ; hlt ; hlt\n";
|
||||||
}
|
}
|
||||||
O << '\n';
|
O << '\n';
|
||||||
|
|
||||||
|
Stubs.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output stubs for external and common global variables.
|
// Output stubs for external and common global variables.
|
||||||
if (!GVStubs.empty()) {
|
Stubs = MMIMacho.GetGVStubList();
|
||||||
|
if (!Stubs.empty()) {
|
||||||
const MCSection *TheSection =
|
const MCSection *TheSection =
|
||||||
TLOFMacho.getMachOSection("__IMPORT", "__pointers",
|
TLOFMacho.getMachOSection("__IMPORT", "__pointers",
|
||||||
MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS,
|
MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS,
|
||||||
SectionKind::getMetadata());
|
SectionKind::getMetadata());
|
||||||
OutStreamer.SwitchSection(TheSection);
|
OutStreamer.SwitchSection(TheSection);
|
||||||
|
|
||||||
std::vector<std::pair<MCSymbol*, MCSymbol*> > Stubs
|
|
||||||
= GetSortedStubs(GVStubs);
|
|
||||||
for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
|
for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
|
||||||
Stubs[i].first->print(O, MAI);
|
Stubs[i].first->print(O, MAI);
|
||||||
O << ":\n\t.indirect_symbol ";
|
O << ":\n\t.indirect_symbol ";
|
||||||
Stubs[i].second->print(O, MAI);
|
Stubs[i].second->print(O, MAI);
|
||||||
O << "\n\t.long\t0\n";
|
O << "\n\t.long\t0\n";
|
||||||
}
|
}
|
||||||
|
Stubs.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!HiddenGVStubs.empty()) {
|
Stubs = MMIMacho.GetHiddenGVStubList();
|
||||||
|
if (!Stubs.empty()) {
|
||||||
OutStreamer.SwitchSection(getObjFileLowering().getDataSection());
|
OutStreamer.SwitchSection(getObjFileLowering().getDataSection());
|
||||||
EmitAlignment(2);
|
EmitAlignment(2);
|
||||||
|
|
||||||
std::vector<std::pair<MCSymbol*, MCSymbol*> > Stubs
|
|
||||||
= GetSortedStubs(HiddenGVStubs);
|
|
||||||
for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
|
for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
|
||||||
Stubs[i].first->print(O, MAI);
|
Stubs[i].first->print(O, MAI);
|
||||||
O << ":\n" << MAI->getData32bitsDirective();
|
O << ":\n" << MAI->getData32bitsDirective();
|
||||||
Stubs[i].second->print(O, MAI);
|
Stubs[i].second->print(O, MAI);
|
||||||
O << '\n';
|
O << '\n';
|
||||||
}
|
}
|
||||||
|
Stubs.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Funny Darwin hack: This flag tells the linker that no global symbols
|
// Funny Darwin hack: This flag tells the linker that no global symbols
|
||||||
|
@ -152,11 +152,6 @@ class VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
|
|||||||
|
|
||||||
void emitFunctionHeader(const MachineFunction &MF);
|
void emitFunctionHeader(const MachineFunction &MF);
|
||||||
|
|
||||||
// Necessary for Darwin to print out the appropriate types of linker stubs.
|
|
||||||
DenseMap<MCSymbol*, MCSymbol*> FnStubs; // Darwin $stub stubs.
|
|
||||||
DenseMap<MCSymbol*, MCSymbol*> GVStubs; // Darwin $non_lazy_ptr stub.
|
|
||||||
DenseMap<MCSymbol*, MCSymbol*> HiddenGVStubs; // Darwin $non_lazy_ptr stub.
|
|
||||||
|
|
||||||
// Necessary for dllexport support
|
// Necessary for dllexport support
|
||||||
StringSet<> CygMingStubs, DLLExportedFns, DLLExportedGVs;
|
StringSet<> CygMingStubs, DLLExportedFns, DLLExportedGVs;
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include "X86MCInstLower.h"
|
#include "X86MCInstLower.h"
|
||||||
#include "X86ATTAsmPrinter.h"
|
#include "X86ATTAsmPrinter.h"
|
||||||
#include "X86MCAsmInfo.h"
|
#include "X86MCAsmInfo.h"
|
||||||
|
#include "llvm/CodeGen/MachineModuleInfoImpls.h"
|
||||||
#include "llvm/MC/MCContext.h"
|
#include "llvm/MC/MCContext.h"
|
||||||
#include "llvm/MC/MCExpr.h"
|
#include "llvm/MC/MCExpr.h"
|
||||||
#include "llvm/MC/MCInst.h"
|
#include "llvm/MC/MCInst.h"
|
||||||
@ -29,6 +30,11 @@ const X86Subtarget &X86MCInstLower::getSubtarget() const {
|
|||||||
return AsmPrinter.getSubtarget();
|
return AsmPrinter.getSubtarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MachineModuleInfoMachO &X86MCInstLower::getMachOMMI() const {
|
||||||
|
assert(getSubtarget().isTargetDarwin() &&"Can only get MachO info on darwin");
|
||||||
|
return AsmPrinter.MMI->getObjFileInfo<MachineModuleInfoMachO>();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
MCSymbol *X86MCInstLower::GetPICBaseSymbol() const {
|
MCSymbol *X86MCInstLower::GetPICBaseSymbol() const {
|
||||||
SmallString<60> Name;
|
SmallString<60> Name;
|
||||||
@ -72,7 +78,8 @@ GetGlobalAddressSymbol(const MachineOperand &MO) const {
|
|||||||
case X86II::MO_DARWIN_NONLAZY_PIC_BASE: {
|
case X86II::MO_DARWIN_NONLAZY_PIC_BASE: {
|
||||||
Name += "$non_lazy_ptr";
|
Name += "$non_lazy_ptr";
|
||||||
MCSymbol *Sym = Ctx.GetOrCreateSymbol(Name.str());
|
MCSymbol *Sym = Ctx.GetOrCreateSymbol(Name.str());
|
||||||
MCSymbol *&StubSym = AsmPrinter.GVStubs[Sym];
|
|
||||||
|
const MCSymbol *&StubSym = getMachOMMI().getGVStubEntry(Sym);
|
||||||
if (StubSym == 0) {
|
if (StubSym == 0) {
|
||||||
Name.clear();
|
Name.clear();
|
||||||
Mang->getNameWithPrefix(Name, GV, false);
|
Mang->getNameWithPrefix(Name, GV, false);
|
||||||
@ -83,7 +90,7 @@ GetGlobalAddressSymbol(const MachineOperand &MO) const {
|
|||||||
case X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE: {
|
case X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE: {
|
||||||
Name += "$non_lazy_ptr";
|
Name += "$non_lazy_ptr";
|
||||||
MCSymbol *Sym = Ctx.GetOrCreateSymbol(Name.str());
|
MCSymbol *Sym = Ctx.GetOrCreateSymbol(Name.str());
|
||||||
MCSymbol *&StubSym = AsmPrinter.HiddenGVStubs[Sym];
|
const MCSymbol *&StubSym = getMachOMMI().getHiddenGVStubEntry(Sym);
|
||||||
if (StubSym == 0) {
|
if (StubSym == 0) {
|
||||||
Name.clear();
|
Name.clear();
|
||||||
Mang->getNameWithPrefix(Name, GV, false);
|
Mang->getNameWithPrefix(Name, GV, false);
|
||||||
@ -94,7 +101,7 @@ GetGlobalAddressSymbol(const MachineOperand &MO) const {
|
|||||||
case X86II::MO_DARWIN_STUB: {
|
case X86II::MO_DARWIN_STUB: {
|
||||||
Name += "$stub";
|
Name += "$stub";
|
||||||
MCSymbol *Sym = Ctx.GetOrCreateSymbol(Name.str());
|
MCSymbol *Sym = Ctx.GetOrCreateSymbol(Name.str());
|
||||||
MCSymbol *&StubSym = AsmPrinter.FnStubs[Sym];
|
const MCSymbol *&StubSym = getMachOMMI().getFnStubEntry(Sym);
|
||||||
if (StubSym == 0) {
|
if (StubSym == 0) {
|
||||||
Name.clear();
|
Name.clear();
|
||||||
Mang->getNameWithPrefix(Name, GV, false);
|
Mang->getNameWithPrefix(Name, GV, false);
|
||||||
@ -138,7 +145,8 @@ GetExternalSymbolSymbol(const MachineOperand &MO) const {
|
|||||||
case X86II::MO_DARWIN_STUB: {
|
case X86II::MO_DARWIN_STUB: {
|
||||||
Name += "$stub";
|
Name += "$stub";
|
||||||
MCSymbol *Sym = Ctx.GetOrCreateSymbol(Name.str());
|
MCSymbol *Sym = Ctx.GetOrCreateSymbol(Name.str());
|
||||||
MCSymbol *&StubSym = AsmPrinter.FnStubs[Sym];
|
const MCSymbol *&StubSym = getMachOMMI().getFnStubEntry(Sym);
|
||||||
|
|
||||||
if (StubSym == 0) {
|
if (StubSym == 0) {
|
||||||
Name.erase(Name.end()-5, Name.end());
|
Name.erase(Name.end()-5, Name.end());
|
||||||
StubSym = Ctx.GetOrCreateSymbol(Name.str());
|
StubSym = Ctx.GetOrCreateSymbol(Name.str());
|
||||||
|
@ -18,6 +18,7 @@ namespace llvm {
|
|||||||
class MCOperand;
|
class MCOperand;
|
||||||
class MCSymbol;
|
class MCSymbol;
|
||||||
class MachineInstr;
|
class MachineInstr;
|
||||||
|
class MachineModuleInfoMachO;
|
||||||
class MachineOperand;
|
class MachineOperand;
|
||||||
class Mangler;
|
class Mangler;
|
||||||
class X86ATTAsmPrinter;
|
class X86ATTAsmPrinter;
|
||||||
@ -43,6 +44,9 @@ public:
|
|||||||
MCSymbol *GetJumpTableSymbol(const MachineOperand &MO) const;
|
MCSymbol *GetJumpTableSymbol(const MachineOperand &MO) const;
|
||||||
MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO) const;
|
MCSymbol *GetConstantPoolIndexSymbol(const MachineOperand &MO) const;
|
||||||
MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
|
MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
MachineModuleInfoMachO &getMachOMMI() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user