diff options
author | Devang Patel <dpatel@apple.com> | 2010-05-26 23:55:23 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-05-26 23:55:23 +0000 |
commit | 80250686d5df7f3b603eeaa08fb94f2765829e0a (patch) | |
tree | 4b7a84ff6e97605a3c90228f75e10b1ed9ee4b65 /lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 8b3ca84a8deeb946114f72d2a6aea243b630c4a8 (diff) |
Simplify. Eliminate unneeded debug_loc entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104785 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index acc168e691..890507cf31 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2210,9 +2210,10 @@ void DwarfDebug::collectVariableInfo(const MachineFunction *MF) { } // handle multiple DBG_VALUE instructions describing one variable. - RegVar->setDotDebugLocOffset(DotDebugLocEntries.size()); if (DotDebugLocEntries.empty()) - DotDebugLocEntries.push_back(DotDebugLocEntry()); + RegVar->setDotDebugLocOffset(0); + else + RegVar->setDotDebugLocOffset(DotDebugLocEntries.size()); const MachineInstr *Begin = NULL; const MachineInstr *End = NULL; for (SmallVector<const MachineInstr *, 4>::iterator @@ -3481,23 +3482,22 @@ void DwarfDebug::emitDebugStr() { /// emitDebugLoc - Emit visible names into a debug loc section. /// void DwarfDebug::emitDebugLoc() { + if (DotDebugLocEntries.empty()) + return; + // Start the dwarf loc section. Asm->OutStreamer.SwitchSection( Asm->getObjFileLowering().getDwarfLocSection()); unsigned char Size = Asm->getTargetData().getPointerSize(); - unsigned index = 0; - bool needMarker = true; + Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("debug_loc", 0)); + unsigned index = 1; for (SmallVector<DotDebugLocEntry, 4>::iterator I = DotDebugLocEntries.begin(), E = DotDebugLocEntries.end(); I != E; ++I, ++index) { DotDebugLocEntry Entry = *I; - if (needMarker) { - Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("debug_loc", index)); - needMarker = false; - } if (Entry.isEmpty()) { Asm->OutStreamer.EmitIntValue(0, Size, /*addrspace*/0); Asm->OutStreamer.EmitIntValue(0, Size, /*addrspace*/0); - needMarker = true; + Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("debug_loc", index)); } else { Asm->OutStreamer.EmitSymbolValue(Entry.Begin, Size, 0); Asm->OutStreamer.EmitSymbolValue(Entry.End, Size, 0); |