mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 23:24:34 +00:00
remove the didInitial ivar, rename emitInitial to be more
descriptive, change EmitSectionOffset back to taking a symbol instead of a string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100361 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -301,8 +301,7 @@ DbgScope::~DbgScope() {
|
|||||||
|
|
||||||
DwarfDebug::DwarfDebug(AsmPrinter *A)
|
DwarfDebug::DwarfDebug(AsmPrinter *A)
|
||||||
: DwarfPrinter(A), ModuleCU(0),
|
: DwarfPrinter(A), ModuleCU(0),
|
||||||
AbbreviationsSet(InitAbbreviationsSetSize), Abbreviations(),
|
AbbreviationsSet(InitAbbreviationsSetSize), shouldEmit(false),
|
||||||
DIEBlocks(), SectionSourceLines(), didInitial(false), shouldEmit(false),
|
|
||||||
CurrentFnDbgScope(0), DebugTimer(0) {
|
CurrentFnDbgScope(0), DebugTimer(0) {
|
||||||
NextStringPoolNumber = 0;
|
NextStringPoolNumber = 0;
|
||||||
if (TimePassesIsEnabled)
|
if (TimePassesIsEnabled)
|
||||||
@ -1835,7 +1834,7 @@ void DwarfDebug::beginModule(Module *M) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Emit initial sections
|
// Emit initial sections
|
||||||
emitInitial();
|
EmitSectionLabels();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// endModule - Emit all Dwarf sections that should come after the content.
|
/// endModule - Emit all Dwarf sections that should come after the content.
|
||||||
@ -2438,13 +2437,9 @@ void DwarfDebug::computeSizeAndOffsets() {
|
|||||||
CompileUnitOffsets[ModuleCU] = 0;
|
CompileUnitOffsets[ModuleCU] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// emitInitial - Emit initial Dwarf declarations. This is necessary for cc
|
/// EmitSectionLabels - Emit initial Dwarf declarations. This is necessary for cc
|
||||||
/// tools to recognize the object file contains Dwarf information.
|
/// tools to recognize the object file contains Dwarf information.
|
||||||
void DwarfDebug::emitInitial() {
|
void DwarfDebug::EmitSectionLabels() {
|
||||||
// Check to see if we already emitted intial headers.
|
|
||||||
if (didInitial) return;
|
|
||||||
didInitial = true;
|
|
||||||
|
|
||||||
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
|
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
|
||||||
|
|
||||||
// Dwarf sections base addresses.
|
// Dwarf sections base addresses.
|
||||||
@ -2566,7 +2561,8 @@ void DwarfDebug::emitDebugInfo() {
|
|||||||
Asm->OutStreamer.AddComment("DWARF version number");
|
Asm->OutStreamer.AddComment("DWARF version number");
|
||||||
Asm->EmitInt16(dwarf::DWARF_VERSION);
|
Asm->EmitInt16(dwarf::DWARF_VERSION);
|
||||||
Asm->OutStreamer.AddComment("Offset Into Abbrev. Section");
|
Asm->OutStreamer.AddComment("Offset Into Abbrev. Section");
|
||||||
EmitSectionOffset(Asm->GetTempSymbol("abbrev_begin"), "section_abbrev");
|
EmitSectionOffset(Asm->GetTempSymbol("abbrev_begin"),
|
||||||
|
Asm->GetTempSymbol("section_abbrev"));
|
||||||
Asm->OutStreamer.AddComment("Address Size (in bytes)");
|
Asm->OutStreamer.AddComment("Address Size (in bytes)");
|
||||||
Asm->EmitInt8(TD->getPointerSize());
|
Asm->EmitInt8(TD->getPointerSize());
|
||||||
|
|
||||||
@ -2878,7 +2874,7 @@ emitFunctionDebugFrame(const FunctionDebugFrameInfo &DebugFrameInfo) {
|
|||||||
|
|
||||||
Asm->OutStreamer.AddComment("FDE CIE offset");
|
Asm->OutStreamer.AddComment("FDE CIE offset");
|
||||||
EmitSectionOffset(Asm->GetTempSymbol("debug_frame_common"),
|
EmitSectionOffset(Asm->GetTempSymbol("debug_frame_common"),
|
||||||
"section_debug_frame");
|
Asm->GetTempSymbol("section_debug_frame"));
|
||||||
|
|
||||||
Asm->OutStreamer.AddComment("FDE initial location");
|
Asm->OutStreamer.AddComment("FDE initial location");
|
||||||
MCSymbol *FuncBeginSym =
|
MCSymbol *FuncBeginSym =
|
||||||
@ -2917,7 +2913,7 @@ void DwarfDebug::emitDebugPubNames() {
|
|||||||
|
|
||||||
Asm->OutStreamer.AddComment("Offset of Compilation Unit Info");
|
Asm->OutStreamer.AddComment("Offset of Compilation Unit Info");
|
||||||
EmitSectionOffset(Asm->GetTempSymbol("info_begin", ModuleCU->getID()),
|
EmitSectionOffset(Asm->GetTempSymbol("info_begin", ModuleCU->getID()),
|
||||||
"section_info");
|
Asm->GetTempSymbol("section_info"));
|
||||||
|
|
||||||
Asm->OutStreamer.AddComment("Compilation Unit Length");
|
Asm->OutStreamer.AddComment("Compilation Unit Length");
|
||||||
Asm->EmitLabelDifference(Asm->GetTempSymbol("info_end", ModuleCU->getID()),
|
Asm->EmitLabelDifference(Asm->GetTempSymbol("info_end", ModuleCU->getID()),
|
||||||
@ -2961,7 +2957,7 @@ void DwarfDebug::emitDebugPubTypes() {
|
|||||||
|
|
||||||
Asm->OutStreamer.AddComment("Offset of Compilation ModuleCU Info");
|
Asm->OutStreamer.AddComment("Offset of Compilation ModuleCU Info");
|
||||||
EmitSectionOffset(Asm->GetTempSymbol("info_begin", ModuleCU->getID()),
|
EmitSectionOffset(Asm->GetTempSymbol("info_begin", ModuleCU->getID()),
|
||||||
"section_info");
|
Asm->GetTempSymbol("section_info"));
|
||||||
|
|
||||||
Asm->OutStreamer.AddComment("Compilation ModuleCU Length");
|
Asm->OutStreamer.AddComment("Compilation ModuleCU Length");
|
||||||
Asm->EmitLabelDifference(Asm->GetTempSymbol("info_end", ModuleCU->getID()),
|
Asm->EmitLabelDifference(Asm->GetTempSymbol("info_end", ModuleCU->getID()),
|
||||||
@ -3107,10 +3103,11 @@ void DwarfDebug::emitDebugInlineInfo() {
|
|||||||
Asm->OutStreamer.EmitIntValue(0, 1, 0); // nul terminator.
|
Asm->OutStreamer.EmitIntValue(0, 1, 0); // nul terminator.
|
||||||
} else
|
} else
|
||||||
EmitSectionOffset(getStringPoolEntry(getRealLinkageName(LName)),
|
EmitSectionOffset(getStringPoolEntry(getRealLinkageName(LName)),
|
||||||
"section_str");
|
Asm->GetTempSymbol("section_str"));
|
||||||
|
|
||||||
Asm->OutStreamer.AddComment("Function name");
|
Asm->OutStreamer.AddComment("Function name");
|
||||||
EmitSectionOffset(getStringPoolEntry(Name), "section_str");
|
EmitSectionOffset(getStringPoolEntry(Name),
|
||||||
|
Asm->GetTempSymbol("section_str"));
|
||||||
Asm->EmitULEB128(Labels.size(), "Inline count");
|
Asm->EmitULEB128(Labels.size(), "Inline count");
|
||||||
|
|
||||||
for (SmallVector<InlineInfoLabels, 4>::iterator LI = Labels.begin(),
|
for (SmallVector<InlineInfoLabels, 4>::iterator LI = Labels.begin(),
|
||||||
|
@ -120,10 +120,6 @@ class DwarfDebug : public DwarfPrinter {
|
|||||||
///
|
///
|
||||||
std::vector<std::vector<SrcLineInfo> > SectionSourceLines;
|
std::vector<std::vector<SrcLineInfo> > SectionSourceLines;
|
||||||
|
|
||||||
/// didInitial - Flag to indicate if initial emission has been done.
|
|
||||||
///
|
|
||||||
bool didInitial;
|
|
||||||
|
|
||||||
/// shouldEmit - Flag to indicate if debug information should be emitted.
|
/// shouldEmit - Flag to indicate if debug information should be emitted.
|
||||||
///
|
///
|
||||||
bool shouldEmit;
|
bool shouldEmit;
|
||||||
@ -396,9 +392,9 @@ class DwarfDebug : public DwarfPrinter {
|
|||||||
/// constructScopeDIE - Construct a DIE for this scope.
|
/// constructScopeDIE - Construct a DIE for this scope.
|
||||||
DIE *constructScopeDIE(DbgScope *Scope);
|
DIE *constructScopeDIE(DbgScope *Scope);
|
||||||
|
|
||||||
/// emitInitial - Emit initial Dwarf declarations. This is necessary for cc
|
/// EmitSectionLabels - Emit initial Dwarf sections with a label at
|
||||||
/// tools to recognize the object file contains Dwarf information.
|
/// the start of each one.
|
||||||
void emitInitial();
|
void EmitSectionLabels();
|
||||||
|
|
||||||
/// emitDIE - Recusively Emits a debug information entry.
|
/// emitDIE - Recusively Emits a debug information entry.
|
||||||
///
|
///
|
||||||
|
@ -35,11 +35,19 @@ using namespace llvm;
|
|||||||
DwarfPrinter::DwarfPrinter(AsmPrinter *A)
|
DwarfPrinter::DwarfPrinter(AsmPrinter *A)
|
||||||
: Asm(A), MAI(A->MAI), TD(Asm->TM.getTargetData()),
|
: Asm(A), MAI(A->MAI), TD(Asm->TM.getTargetData()),
|
||||||
RI(Asm->TM.getRegisterInfo()), M(NULL), MF(NULL), MMI(NULL),
|
RI(Asm->TM.getRegisterInfo()), M(NULL), MF(NULL), MMI(NULL),
|
||||||
SubprogramCount(0) {}
|
SubprogramCount(0) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// EmitSectionOffset - Emit the 4-byte offset of Label from the start of its
|
||||||
|
/// section. This can be done with a special directive if the target supports
|
||||||
|
/// it (e.g. cygwin) or by emitting it as an offset from a label at the start
|
||||||
|
/// of the section.
|
||||||
|
///
|
||||||
|
/// SectionLabel is a temporary label emitted at the start of the section that
|
||||||
|
/// Label lives in.
|
||||||
void DwarfPrinter::EmitSectionOffset(const MCSymbol *Label,
|
void DwarfPrinter::EmitSectionOffset(const MCSymbol *Label,
|
||||||
const char *SectionLabel) {
|
const MCSymbol *SectionLabel) const {
|
||||||
// On COFF targets, we have to emit the special .secrel32 directive.
|
// On COFF targets, we have to emit the special .secrel32 directive.
|
||||||
if (const char *SecOffDir = MAI->getDwarfSectionOffsetDirective()) {
|
if (const char *SecOffDir = MAI->getDwarfSectionOffsetDirective()) {
|
||||||
// FIXME: MCize.
|
// FIXME: MCize.
|
||||||
@ -54,8 +62,7 @@ void DwarfPrinter::EmitSectionOffset(const MCSymbol *Label,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MCSymbol *SectionSym = Asm->GetTempSymbol(SectionLabel);
|
Asm->EmitLabelDifference(Label, SectionLabel, 4);
|
||||||
Asm->EmitLabelDifference(Label, SectionSym, 4);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// EmitFrameMoves - Emit frame instructions to describe the layout of the
|
/// EmitFrameMoves - Emit frame instructions to describe the layout of the
|
||||||
|
@ -79,9 +79,10 @@ public:
|
|||||||
/// it (e.g. cygwin) or by emitting it as an offset from a label at the start
|
/// it (e.g. cygwin) or by emitting it as an offset from a label at the start
|
||||||
/// of the section.
|
/// of the section.
|
||||||
///
|
///
|
||||||
/// SectionLabel is the name of a temporary label emitted at the start of the
|
/// SectionLabel is a temporary label emitted at the start of the section that
|
||||||
/// section.
|
/// Label lives in.
|
||||||
void EmitSectionOffset(const MCSymbol *Label, const char *SectionLabel);
|
void EmitSectionOffset(const MCSymbol *Label,
|
||||||
|
const MCSymbol *SectionLabel) const;
|
||||||
|
|
||||||
/// EmitFrameMoves - Emit frame instructions to describe the layout of the
|
/// EmitFrameMoves - Emit frame instructions to describe the layout of the
|
||||||
/// frame.
|
/// frame.
|
||||||
|
Reference in New Issue
Block a user