llvm.org GIT mirror llvm / 8025068
Simplify. Eliminate unneeded debug_loc entry. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104785 91177308-0d34-0410-b5e6-96231b3b80d8 Devang Patel 10 years ago
3 changed file(s) with 12 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
22092209 }
22102210
22112211 // handle multiple DBG_VALUE instructions describing one variable.
2212 RegVar->setDotDebugLocOffset(DotDebugLocEntries.size());
22132212 if (DotDebugLocEntries.empty())
2214 DotDebugLocEntries.push_back(DotDebugLocEntry());
2213 RegVar->setDotDebugLocOffset(0);
2214 else
2215 RegVar->setDotDebugLocOffset(DotDebugLocEntries.size());
22152216 const MachineInstr *Begin = NULL;
22162217 const MachineInstr *End = NULL;
22172218 for (SmallVector::iterator
34803481 /// emitDebugLoc - Emit visible names into a debug loc section.
34813482 ///
34823483 void DwarfDebug::emitDebugLoc() {
3484 if (DotDebugLocEntries.empty())
3485 return;
3486
34833487 // Start the dwarf loc section.
34843488 Asm->OutStreamer.SwitchSection(
34853489 Asm->getObjFileLowering().getDwarfLocSection());
34863490 unsigned char Size = Asm->getTargetData().getPointerSize();
3487 unsigned index = 0;
3488 bool needMarker = true;
3491 Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("debug_loc", 0));
3492 unsigned index = 1;
34893493 for (SmallVector::iterator I = DotDebugLocEntries.begin(),
34903494 E = DotDebugLocEntries.end(); I != E; ++I, ++index) {
34913495 DotDebugLocEntry Entry = *I;
3492 if (needMarker) {
3493 Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("debug_loc", index));
3494 needMarker = false;
3495 }
34963496 if (Entry.isEmpty()) {
34973497 Asm->OutStreamer.EmitIntValue(0, Size, /*addrspace*/0);
34983498 Asm->OutStreamer.EmitIntValue(0, Size, /*addrspace*/0);
3499 needMarker = true;
3499 Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("debug_loc", index));
35003500 } else {
35013501 Asm->OutStreamer.EmitSymbolValue(Entry.Begin, Size, 0);
35023502 Asm->OutStreamer.EmitSymbolValue(Entry.End, Size, 0);
5454 !29 = metadata !{i32 524299, metadata !9, i32 17, i32 0} ; [ DW_TAG_lexical_block ]
5555 !30 = metadata !{i32 19, i32 0, metadata !29, null}
5656
57 ; CHECK: Ldebug_loc1
57 ; CHECK: Ldebug_loc0:
5858 ; CHECK-NEXT: .quad Lfunc_begin0
5959 ; CHECK-NEXT: .quad Ltmp3
6060 ; CHECK-NEXT: .short 1
None ; RUN: llc -O2 < %s | grep debug_loc13
1 ; Test to check .debug_loc support. This test case emits 14 debug_loc entries.
0 ; RUN: llc -O2 < %s | grep debug_loc12
1 ; Test to check .debug_loc support. This test case emits 13 debug_loc entries.
22
33 %0 = type { double }
44