summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-03-24 22:27:06 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-03-24 22:27:06 +0000
commit34ec5d07e1a145eb0cfabe65f7db442c1a97eb43 (patch)
tree5350d75f127b6fde3f2696a184731013fb54f3f9 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
parent4fdb0708171b957e341e610f2fb64fa0fb1ffd1a (diff)
downloadbcm5719-llvm-34ec5d07e1a145eb0cfabe65f7db442c1a97eb43.tar.gz
bcm5719-llvm-34ec5d07e1a145eb0cfabe65f7db442c1a97eb43.zip
DwarfDebug: Simplify debug_loc merging
No functional change intended. Merging up-front rather than delaying this task until later. This just seems simpler and more efficient (avoiding growing the debug loc list only to have to skip over those post-merged entries, etc). llvm-svn: 204679
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h24
1 files changed, 10 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 71ea0fb4e72..2d073e380c0 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -84,34 +84,31 @@ class DebugLocEntry {
// The compile unit to which this location entry is referenced by.
const DwarfCompileUnit *Unit;
- // Whether this location has been merged.
- bool Merged;
-
public:
- DebugLocEntry() : Begin(0), End(0), Variable(0), Unit(0), Merged(false) {
+ DebugLocEntry() : Begin(0), End(0), Variable(0), Unit(0) {
Constants.Int = 0;
}
DebugLocEntry(const MCSymbol *B, const MCSymbol *E, MachineLocation &L,
const MDNode *V, const DwarfCompileUnit *U)
- : Begin(B), End(E), Loc(L), Variable(V), Unit(U), Merged(false) {
+ : Begin(B), End(E), Loc(L), Variable(V), Unit(U) {
Constants.Int = 0;
EntryKind = E_Location;
}
DebugLocEntry(const MCSymbol *B, const MCSymbol *E, int64_t i,
const DwarfCompileUnit *U)
- : Begin(B), End(E), Variable(0), Unit(U), Merged(false) {
+ : Begin(B), End(E), Variable(0), Unit(U) {
Constants.Int = i;
EntryKind = E_Integer;
}
DebugLocEntry(const MCSymbol *B, const MCSymbol *E, const ConstantFP *FPtr,
const DwarfCompileUnit *U)
- : Begin(B), End(E), Variable(0), Unit(U), Merged(false) {
+ : Begin(B), End(E), Variable(0), Unit(U) {
Constants.CFP = FPtr;
EntryKind = E_ConstantFP;
}
DebugLocEntry(const MCSymbol *B, const MCSymbol *E, const ConstantInt *IPtr,
const DwarfCompileUnit *U)
- : Begin(B), End(E), Variable(0), Unit(U), Merged(false) {
+ : Begin(B), End(E), Variable(0), Unit(U) {
Constants.CIP = IPtr;
EntryKind = E_ConstantInt;
}
@@ -119,12 +116,11 @@ public:
/// \brief Empty entries are also used as a trigger to emit temp label. Such
/// labels are referenced is used to find debug_loc offset for a given DIE.
bool isEmpty() const { return Begin == 0 && End == 0; }
- bool isMerged() const { return Merged; }
- void Merge(DebugLocEntry *Next) {
- if (!(Begin && Loc == Next->Loc && End == Next->Begin))
- return;
- Next->Begin = Begin;
- Merged = true;
+ bool Merge(const DebugLocEntry &Next) {
+ if (!(Begin && Loc == Next.Loc && End == Next.Begin))
+ return false;
+ End = Next.End;
+ return true;
}
bool isLocation() const { return EntryKind == E_Location; }
bool isInt() const { return EntryKind == E_Integer; }
OpenPOWER on IntegriCloud