[llvm] r373540 - DebugInfo: Rename DebugLocStream::Entry::Begin/EndSym to just Begin/End
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 2 15:58:02 PDT 2019
Author: dblaikie
Date: Wed Oct 2 15:58:02 2019
New Revision: 373540
URL: http://llvm.org/viewvc/llvm-project?rev=373540&view=rev
Log:
DebugInfo: Rename DebugLocStream::Entry::Begin/EndSym to just Begin/End
Brings this struct in line with the RangeSpan class so they might
eventually be used by common template code for generating range/loc
lists with less duplicate code.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DebugLocStream.h
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DebugLocStream.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DebugLocStream.h?rev=373540&r1=373539&r2=373540&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DebugLocStream.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DebugLocStream.h Wed Oct 2 15:58:02 2019
@@ -38,14 +38,10 @@ public:
: CU(CU), EntryOffset(EntryOffset) {}
};
struct Entry {
- const MCSymbol *BeginSym;
- const MCSymbol *EndSym;
+ const MCSymbol *Begin;
+ const MCSymbol *End;
size_t ByteOffset;
size_t CommentOffset;
- Entry(const MCSymbol *BeginSym, const MCSymbol *EndSym, size_t ByteOffset,
- size_t CommentOffset)
- : BeginSym(BeginSym), EndSym(EndSym), ByteOffset(ByteOffset),
- CommentOffset(CommentOffset) {}
};
private:
@@ -93,7 +89,7 @@ private:
/// Until the next call, bytes added to the stream will be added to this
/// entry.
void startEntry(const MCSymbol *BeginSym, const MCSymbol *EndSym) {
- Entries.emplace_back(BeginSym, EndSym, DWARFBytes.size(), Comments.size());
+ Entries.push_back({BeginSym, EndSym, DWARFBytes.size(), Comments.size()});
}
/// Finalize a .debug_loc entry, deleting if it's empty.
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=373540&r1=373539&r2=373540&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Oct 2 15:58:02 2019
@@ -2325,12 +2325,12 @@ void DwarfDebug::emitDebugLoc() {
Asm->OutStreamer->AddComment("DW_LLE_offset_pair");
Asm->OutStreamer->EmitIntValue(dwarf::DW_LLE_offset_pair, 1);
Asm->OutStreamer->AddComment(" starting offset");
- Asm->EmitLabelDifferenceAsULEB128(Entry.BeginSym, Base);
+ Asm->EmitLabelDifferenceAsULEB128(Entry.Begin, Base);
Asm->OutStreamer->AddComment(" ending offset");
- Asm->EmitLabelDifferenceAsULEB128(Entry.EndSym, Base);
+ Asm->EmitLabelDifferenceAsULEB128(Entry.End, Base);
} else {
- Asm->EmitLabelDifference(Entry.BeginSym, Base, Size);
- Asm->EmitLabelDifference(Entry.EndSym, Base, Size);
+ Asm->EmitLabelDifference(Entry.Begin, Base, Size);
+ Asm->EmitLabelDifference(Entry.End, Base, Size);
}
emitDebugLocEntryLocation(Entry, CU);
@@ -2346,12 +2346,12 @@ void DwarfDebug::emitDebugLoc() {
Asm->OutStreamer->AddComment("DW_LLE_startx_length");
Asm->emitInt8(dwarf::DW_LLE_startx_length);
Asm->OutStreamer->AddComment(" start idx");
- Asm->EmitULEB128(AddrPool.getIndex(Entry.BeginSym));
+ Asm->EmitULEB128(AddrPool.getIndex(Entry.Begin));
Asm->OutStreamer->AddComment(" length");
- Asm->EmitLabelDifferenceAsULEB128(Entry.EndSym, Entry.BeginSym);
+ Asm->EmitLabelDifferenceAsULEB128(Entry.End, Entry.Begin);
} else {
- Asm->OutStreamer->EmitSymbolValue(Entry.BeginSym, Size);
- Asm->OutStreamer->EmitSymbolValue(Entry.EndSym, Size);
+ Asm->OutStreamer->EmitSymbolValue(Entry.Begin, Size);
+ Asm->OutStreamer->EmitSymbolValue(Entry.End, Size);
}
emitDebugLocEntryLocation(Entry, CU);
@@ -2386,9 +2386,9 @@ void DwarfDebug::emitDebugLocDWO() {
// Ideally/in v5, this could use SectionLabels to reuse existing addresses
// in the address pool to minimize object size/relocations.
Asm->emitInt8(dwarf::DW_LLE_startx_length);
- unsigned idx = AddrPool.getIndex(Entry.BeginSym);
+ unsigned idx = AddrPool.getIndex(Entry.Begin);
Asm->EmitULEB128(idx);
- Asm->EmitLabelDifference(Entry.EndSym, Entry.BeginSym, 4);
+ Asm->EmitLabelDifference(Entry.End, Entry.Begin, 4);
emitDebugLocEntryLocation(Entry, List.CU);
}
More information about the llvm-commits
mailing list