diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-03-24 22:27:06 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-03-24 22:27:06 +0000 |
commit | 34ec5d07e1a145eb0cfabe65f7db442c1a97eb43 (patch) | |
tree | 5350d75f127b6fde3f2696a184731013fb54f3f9 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 4fdb0708171b957e341e610f2fb64fa0fb1ffd1a (diff) | |
download | bcm5719-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.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index ba81adbff85..3f794ad8ff5 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1297,8 +1297,9 @@ DwarfDebug::collectVariableInfo(SmallPtrSet<const MDNode *, 16> &Processed) { // The value is valid until the next DBG_VALUE or clobber. LexicalScope *FnScope = LScopes.getCurrentFunctionScope(); DwarfCompileUnit *TheCU = SPMap.lookup(FnScope->getScopeNode()); - DotDebugLocEntries.push_back( - getDebugLocEntry(Asm, FLabel, SLabel, Begin, TheCU)); + DebugLocEntry Loc = getDebugLocEntry(Asm, FLabel, SLabel, Begin, TheCU); + if (DotDebugLocEntries.empty() || !DotDebugLocEntries.back().Merge(Loc)) + DotDebugLocEntries.push_back(std::move(Loc)); } DotDebugLocEntries.push_back(DebugLocEntry()); } @@ -2378,15 +2379,6 @@ void DwarfDebug::emitDebugLoc() { if (DotDebugLocEntries.empty()) return; - for (SmallVectorImpl<DebugLocEntry>::iterator - I = DotDebugLocEntries.begin(), - E = DotDebugLocEntries.end(); - I != E; ++I) { - DebugLocEntry &Entry = *I; - if (I + 1 != DotDebugLocEntries.end()) - Entry.Merge(I + 1); - } - // Start the dwarf loc section. Asm->OutStreamer.SwitchSection( Asm->getObjFileLowering().getDwarfLocSection()); @@ -2398,8 +2390,6 @@ void DwarfDebug::emitDebugLoc() { E = DotDebugLocEntries.end(); I != E; ++I, ++index) { const DebugLocEntry &Entry = *I; - if (Entry.isMerged()) - continue; if (Entry.isEmpty()) { Asm->OutStreamer.EmitIntValue(0, Size); |