mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-05 01:31:05 +00:00
DebugInfo: Factor out common functionality for rendering debug_loc and debug_loc.dwo location list entries
In preparation for refactoring this function into two, one for debug_loc, one for debug_loc.dwo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205324 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6817d33dda
commit
6b10f3a87d
@ -2386,6 +2386,19 @@ void DwarfDebug::emitDebugLocEntry(ByteStreamer &Streamer,
|
||||
// FIXME: ^
|
||||
}
|
||||
|
||||
void DwarfDebug::emitDebugLocEntryLocation(const DebugLocEntry &Entry) {
|
||||
Asm->OutStreamer.AddComment("Loc expr size");
|
||||
MCSymbol *begin = Asm->OutStreamer.getContext().CreateTempSymbol();
|
||||
MCSymbol *end = Asm->OutStreamer.getContext().CreateTempSymbol();
|
||||
Asm->EmitLabelDifference(end, begin, 2);
|
||||
Asm->OutStreamer.EmitLabel(begin);
|
||||
// Emit the entry.
|
||||
APByteStreamer Streamer(*Asm);
|
||||
emitDebugLocEntry(Streamer, Entry);
|
||||
// Close the range.
|
||||
Asm->OutStreamer.EmitLabel(end);
|
||||
}
|
||||
|
||||
// Emit locations into the debug loc section.
|
||||
void DwarfDebug::emitDebugLoc() {
|
||||
// Start the dwarf loc section.
|
||||
@ -2419,16 +2432,7 @@ void DwarfDebug::emitDebugLoc() {
|
||||
Asm->OutStreamer.EmitSymbolValue(Entry.getBeginSym(), Size);
|
||||
Asm->OutStreamer.EmitSymbolValue(Entry.getEndSym(), Size);
|
||||
}
|
||||
Asm->OutStreamer.AddComment("Loc expr size");
|
||||
MCSymbol *begin = Asm->OutStreamer.getContext().CreateTempSymbol();
|
||||
MCSymbol *end = Asm->OutStreamer.getContext().CreateTempSymbol();
|
||||
Asm->EmitLabelDifference(end, begin, 2);
|
||||
Asm->OutStreamer.EmitLabel(begin);
|
||||
// Emit the entry.
|
||||
APByteStreamer Streamer(*Asm);
|
||||
emitDebugLocEntry(Streamer, Entry);
|
||||
// Close the range.
|
||||
Asm->OutStreamer.EmitLabel(end);
|
||||
emitDebugLocEntryLocation(Entry);
|
||||
}
|
||||
if (useSplitDwarf())
|
||||
Asm->EmitInt8(dwarf::DW_LLE_end_of_list_entry);
|
||||
|
@ -772,6 +772,9 @@ public:
|
||||
/// handle an entry that's going to be emitted into the debug loc section.
|
||||
void emitDebugLocEntry(ByteStreamer &Streamer, const DebugLocEntry &Entry);
|
||||
|
||||
/// Emit the location for a debug loc entry, including the size header.
|
||||
void emitDebugLocEntryLocation(const DebugLocEntry &Entry);
|
||||
|
||||
/// Find the MDNode for the given reference.
|
||||
template <typename T> T resolve(DIRef<T> Ref) const {
|
||||
return Ref.resolve(TypeIdentifierMap);
|
||||
|
Loading…
x
Reference in New Issue
Block a user