[llvm] r216719 - Use DwarfDebug::attachLowHighPC for the compilation unit DIE.
Frederic Riss
friss at apple.com
Fri Aug 29 02:00:27 PDT 2014
Author: friss
Date: Fri Aug 29 04:00:26 2014
New Revision: 216719
URL: http://llvm.org/viewvc/llvm-project?rev=216719&view=rev
Log:
Use DwarfDebug::attachLowHighPC for the compilation unit DIE.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/test/DebugInfo/X86/lexical_block.ll
llvm/trunk/test/DebugInfo/X86/low-pc-cu.ll
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=216719&r1=216718&r2=216719&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Aug 29 04:00:26 2014
@@ -950,10 +950,7 @@ void DwarfDebug::finalizeModuleInfo() {
0);
} else {
RangeSpan &Range = TheU->getRanges().back();
- U.addLocalLabelAddress(U.getUnitDie(), dwarf::DW_AT_low_pc,
- Range.getStart());
- U.addLabelDelta(U.getUnitDie(), dwarf::DW_AT_high_pc, Range.getEnd(),
- Range.getStart());
+ attachLowHighPC(U, U.getUnitDie(), Range.getStart(), Range.getEnd());
}
}
}
Modified: llvm/trunk/test/DebugInfo/X86/lexical_block.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/lexical_block.ll?rev=216719&r1=216718&r2=216719&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/lexical_block.ll (original)
+++ llvm/trunk/test/DebugInfo/X86/lexical_block.ll Fri Aug 29 04:00:26 2014
@@ -1,11 +1,19 @@
; REQUIRES: object-emission
; RUN: llc -mtriple=x86_64-linux -O0 -filetype=obj < %s \
-; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s
+; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=CHECK-V4 %s
+; RUN: llc -mtriple=x86_64-linux -dwarf-version=3 -O0 -filetype=obj < %s \
+; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=CHECK-V3 %s
+
+; Check that we emit DW_TAG_lexical_block and that it has the right encoding
+; depending on the dwarf version.
; CHECK: DW_TAG_lexical_block
-; CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr]
-; CHECK-NEXT: DW_AT_high_pc [DW_FORM_data4]
+; CHECK-NOT: {{DW_TAG|NULL}}
+; CHECK: DW_AT_low_pc [DW_FORM_addr]
+; CHECK-NOT: {{DW_TAG|NULL}}
+; CHECK-V4: DW_AT_high_pc [DW_FORM_data4]
+; CHECK-V3: DW_AT_high_pc [DW_FORM_addr]
; Test case produced from:
; void b() {
Modified: llvm/trunk/test/DebugInfo/X86/low-pc-cu.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/low-pc-cu.ll?rev=216719&r1=216718&r2=216719&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/low-pc-cu.ll (original)
+++ llvm/trunk/test/DebugInfo/X86/low-pc-cu.ll Fri Aug 29 04:00:26 2014
@@ -1,14 +1,24 @@
-; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
-; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
+; RUN: llc -mtriple=x86_64-apple-darwin -filetype=obj < %s \
+; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-V4
+; RUN: llc -mtriple=x86_64-apple-darwin -filetype=obj -dwarf-version=3 < %s \
+; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-V3
-; Check that we use DW_AT_low_pc
+
+; Check that we use DW_AT_low_pc and that it has the right encoding depending
+; on dwarf version.
; CHECK: DW_TAG_compile_unit [1]
+; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
-; CHECK: DW_AT_high_pc [DW_FORM_data4]
+; CHECK-NOT: {{DW_TAG|NULL}}
+; CHECK-V3: DW_AT_high_pc [DW_FORM_addr]
+; CHECK-V4: DW_AT_high_pc [DW_FORM_data4]
; CHECK: DW_TAG_subprogram [2]
+; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: DW_AT_low_pc [DW_FORM_addr]
-; CHECK: DW_AT_high_pc [DW_FORM_data4]
+; CHECK-NOT: {{DW_TAG|NULL}}
+; CHECK-V3: DW_AT_high_pc [DW_FORM_addr]
+; CHECK-V4: DW_AT_high_pc [DW_FORM_data4]
; Function Attrs: nounwind uwtable
define void @z() #0 {
More information about the llvm-commits
mailing list