mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-26 07:29:55 +00:00
Reformat and hoist section grabbing to top level.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190648 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5251d180f4
commit
5704d640ab
@ -2348,54 +2348,59 @@ void DwarfDebug::emitDebugPubNames() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DwarfDebug::emitDebugPubTypes() {
|
void DwarfDebug::emitDebugPubTypes() {
|
||||||
|
const MCSection *ISec = Asm->getObjFileLowering().getDwarfInfoSection();
|
||||||
|
const MCSection *PSec = Asm->getObjFileLowering().getDwarfPubTypesSection();
|
||||||
|
|
||||||
for (DenseMap<const MDNode *, CompileUnit *>::iterator I = CUMap.begin(),
|
for (DenseMap<const MDNode *, CompileUnit *>::iterator I = CUMap.begin(),
|
||||||
E = CUMap.end(); I != E; ++I) {
|
E = CUMap.end();
|
||||||
|
I != E; ++I) {
|
||||||
CompileUnit *TheCU = I->second;
|
CompileUnit *TheCU = I->second;
|
||||||
// Start the dwarf pubtypes section.
|
// Start the dwarf pubtypes section.
|
||||||
Asm->OutStreamer.SwitchSection(
|
Asm->OutStreamer.SwitchSection(PSec);
|
||||||
Asm->getObjFileLowering().getDwarfPubTypesSection());
|
|
||||||
Asm->OutStreamer.AddComment("Length of Public Types Info");
|
Asm->OutStreamer.AddComment("Length of Public Types Info");
|
||||||
Asm->EmitLabelDifference(
|
Asm->EmitLabelDifference(
|
||||||
Asm->GetTempSymbol("pubtypes_end", TheCU->getUniqueID()),
|
Asm->GetTempSymbol("pubtypes_end", TheCU->getUniqueID()),
|
||||||
Asm->GetTempSymbol("pubtypes_begin", TheCU->getUniqueID()), 4);
|
Asm->GetTempSymbol("pubtypes_begin", TheCU->getUniqueID()), 4);
|
||||||
|
|
||||||
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("pubtypes_begin",
|
Asm->OutStreamer.EmitLabel(
|
||||||
TheCU->getUniqueID()));
|
Asm->GetTempSymbol("pubtypes_begin", TheCU->getUniqueID()));
|
||||||
|
|
||||||
if (Asm->isVerbose()) Asm->OutStreamer.AddComment("DWARF Version");
|
if (Asm->isVerbose())
|
||||||
|
Asm->OutStreamer.AddComment("DWARF Version");
|
||||||
Asm->EmitInt16(dwarf::DW_PUBTYPES_VERSION);
|
Asm->EmitInt16(dwarf::DW_PUBTYPES_VERSION);
|
||||||
|
|
||||||
Asm->OutStreamer.AddComment("Offset of Compilation Unit Info");
|
Asm->OutStreamer.AddComment("Offset of Compilation Unit Info");
|
||||||
const MCSection *ISec = Asm->getObjFileLowering().getDwarfInfoSection();
|
Asm->EmitSectionOffset(
|
||||||
Asm->EmitSectionOffset(Asm->GetTempSymbol(ISec->getLabelBeginName(),
|
Asm->GetTempSymbol(ISec->getLabelBeginName(), TheCU->getUniqueID()),
|
||||||
TheCU->getUniqueID()),
|
|
||||||
DwarfInfoSectionSym);
|
DwarfInfoSectionSym);
|
||||||
|
|
||||||
Asm->OutStreamer.AddComment("Compilation Unit Length");
|
Asm->OutStreamer.AddComment("Compilation Unit Length");
|
||||||
Asm->EmitLabelDifference(Asm->GetTempSymbol(ISec->getLabelEndName(),
|
Asm->EmitLabelDifference(
|
||||||
TheCU->getUniqueID()),
|
Asm->GetTempSymbol(ISec->getLabelEndName(), TheCU->getUniqueID()),
|
||||||
Asm->GetTempSymbol(ISec->getLabelBeginName(),
|
Asm->GetTempSymbol(ISec->getLabelBeginName(), TheCU->getUniqueID()), 4);
|
||||||
TheCU->getUniqueID()),
|
|
||||||
4);
|
|
||||||
|
|
||||||
const StringMap<DIE*> &Globals = TheCU->getGlobalTypes();
|
const StringMap<DIE *> &Globals = TheCU->getGlobalTypes();
|
||||||
for (StringMap<DIE*>::const_iterator
|
for (StringMap<DIE *>::const_iterator GI = Globals.begin(),
|
||||||
GI = Globals.begin(), GE = Globals.end(); GI != GE; ++GI) {
|
GE = Globals.end();
|
||||||
|
GI != GE; ++GI) {
|
||||||
const char *Name = GI->getKeyData();
|
const char *Name = GI->getKeyData();
|
||||||
DIE *Entity = GI->second;
|
DIE *Entity = GI->second;
|
||||||
|
|
||||||
if (Asm->isVerbose()) Asm->OutStreamer.AddComment("DIE offset");
|
if (Asm->isVerbose())
|
||||||
|
Asm->OutStreamer.AddComment("DIE offset");
|
||||||
Asm->EmitInt32(Entity->getOffset());
|
Asm->EmitInt32(Entity->getOffset());
|
||||||
|
|
||||||
if (Asm->isVerbose()) Asm->OutStreamer.AddComment("External Name");
|
if (Asm->isVerbose())
|
||||||
|
Asm->OutStreamer.AddComment("External Name");
|
||||||
|
|
||||||
// Emit the name with a terminating null byte.
|
// Emit the name with a terminating null byte.
|
||||||
Asm->OutStreamer.EmitBytes(StringRef(Name, GI->getKeyLength()+1));
|
Asm->OutStreamer.EmitBytes(StringRef(Name, GI->getKeyLength() + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
Asm->OutStreamer.AddComment("End Mark");
|
Asm->OutStreamer.AddComment("End Mark");
|
||||||
Asm->EmitInt32(0);
|
Asm->EmitInt32(0);
|
||||||
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("pubtypes_end",
|
Asm->OutStreamer.EmitLabel(
|
||||||
TheCU->getUniqueID()));
|
Asm->GetTempSymbol("pubtypes_end", TheCU->getUniqueID()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user