mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 23:24:59 +00:00
Refactor a lot of duplicated code for stub output.
This also moves it earlier so that it they are produced before we print an end symbol for the data section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234315 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1105,25 +1105,6 @@ bool PPCLinuxAsmPrinter::doFinalization(Module &M) {
|
||||
}
|
||||
}
|
||||
|
||||
MachineModuleInfoELF &MMIELF =
|
||||
MMI->getObjFileInfo<MachineModuleInfoELF>();
|
||||
|
||||
MachineModuleInfoELF::SymbolListTy Stubs = MMIELF.GetGVStubList();
|
||||
if (!Stubs.empty()) {
|
||||
OutStreamer.SwitchSection(getObjFileLowering().getDataSection());
|
||||
for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
|
||||
// L_foo$stub:
|
||||
OutStreamer.EmitLabel(Stubs[i].first);
|
||||
// .long _foo
|
||||
OutStreamer.EmitValue(MCSymbolRefExpr::Create(Stubs[i].second.getPointer(),
|
||||
OutContext),
|
||||
isPPC64 ? 8 : 4/*size*/);
|
||||
}
|
||||
|
||||
Stubs.clear();
|
||||
OutStreamer.AddBlankLine();
|
||||
}
|
||||
|
||||
return AsmPrinter::doFinalization(M);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user