mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +00:00
switch HiddenGVStubs to be a DenseMap instead of a string map, mirroring FnStubs and GVStubs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81514 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
46091d70f5
commit
9e6ffba26b
@ -330,7 +330,16 @@ void X86ATTAsmPrinter::printSymbolOperand(const MachineOperand &MO) {
|
||||
StubSym = OutContext.GetOrCreateSymbol(NameStr.str());
|
||||
}
|
||||
} else if (MO.getTargetFlags() == X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE){
|
||||
HiddenGVStubs[Name] = Mang->getMangledName(GV);
|
||||
SmallString<128> NameStr;
|
||||
Mang->getNameWithPrefix(NameStr, GV, true);
|
||||
NameStr += "$non_lazy_ptr";
|
||||
MCSymbol *Sym = OutContext.GetOrCreateSymbol(NameStr.str());
|
||||
MCSymbol *&StubSym = HiddenGVStubs[Sym];
|
||||
if (StubSym == 0) {
|
||||
NameStr.clear();
|
||||
Mang->getNameWithPrefix(NameStr, GV, false);
|
||||
StubSym = OutContext.GetOrCreateSymbol(NameStr.str());
|
||||
}
|
||||
} else if (MO.getTargetFlags() == X86II::MO_DARWIN_STUB) {
|
||||
SmallString<128> NameStr;
|
||||
Mang->getNameWithPrefix(NameStr, GV, true);
|
||||
@ -949,10 +958,13 @@ bool X86ATTAsmPrinter::doFinalization(Module &M) {
|
||||
if (!HiddenGVStubs.empty()) {
|
||||
OutStreamer.SwitchSection(getObjFileLowering().getDataSection());
|
||||
EmitAlignment(2);
|
||||
for (StringMap<std::string>::iterator I = HiddenGVStubs.begin(),
|
||||
E = HiddenGVStubs.end(); I != E; ++I)
|
||||
O << I->getKeyData() << ":\n" << MAI->getData32bitsDirective()
|
||||
<< I->second << '\n';
|
||||
for (DenseMap<MCSymbol*, MCSymbol*>::iterator I = HiddenGVStubs.begin(),
|
||||
E = HiddenGVStubs.end(); I != E; ++I) {
|
||||
I->first->print(O, MAI);
|
||||
O << ":\n" << MAI->getData32bitsDirective();
|
||||
I->second->print(O, MAI);
|
||||
O << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
// Funny Darwin hack: This flag tells the linker that no global symbols
|
||||
|
@ -215,10 +215,10 @@ class VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
|
||||
|
||||
void emitFunctionHeader(const MachineFunction &MF);
|
||||
|
||||
// Necessary for Darwin to print out the apprioriate types of linker stubs
|
||||
StringMap<std::string> HiddenGVStubs;
|
||||
// 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
|
||||
StringSet<> CygMingStubs, DLLExportedFns, DLLExportedGVs;
|
||||
|
@ -82,10 +82,17 @@ MCSymbol *X86ATTAsmPrinter::GetGlobalAddressSymbol(const MachineOperand &MO) {
|
||||
return Sym;
|
||||
|
||||
}
|
||||
case X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE:
|
||||
case X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE: {
|
||||
Name += "$non_lazy_ptr";
|
||||
HiddenGVStubs[Name.str()] = StringRef(Name.data(), Name.size()-13);
|
||||
MCSymbol *Sym = OutContext.GetOrCreateSymbol(Name.str());
|
||||
MCSymbol *&StubSym = HiddenGVStubs[Sym];
|
||||
if (StubSym == 0) {
|
||||
Name.clear();
|
||||
Mang->getNameWithPrefix(Name, GV, false);
|
||||
StubSym = OutContext.GetOrCreateSymbol(Name.str());
|
||||
}
|
||||
break;
|
||||
}
|
||||
case X86II::MO_DARWIN_STUB: {
|
||||
Name += "$stub";
|
||||
MCSymbol *Sym = OutContext.GetOrCreateSymbol(Name.str());
|
||||
|
Loading…
Reference in New Issue
Block a user