summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-09-13 13:13:50 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-09-13 13:13:50 +0000
commit64c901d2b11e75a89f8f69a03f55e67f59b617b5 (patch)
tree95b4ebde843dc847d47a9979c3e544fb94e4b3ab
parent45be5cf0edd40426b6e8814d9b6814a6b62c722e (diff)
[MC/Dwarf] Unclamp DWARF linetables format on Darwin.
In r319995, we fixed the line table format to version 2 on Darwin because dsymutil didn't yet understand the new format which caused test failures for the LLDB bots. This has been resolved in the meantime so there's no reason to keep this limitation. rdar://problem/35968332 llvm-svn: 342136
-rw-r--r--llvm/lib/MC/MCDwarf.cpp8
-rw-r--r--llvm/test/CodeGen/Generic/dwarf-md5.ll3
-rw-r--r--llvm/test/CodeGen/Generic/dwarf-source.ll3
-rw-r--r--llvm/test/DebugInfo/X86/nodebug.ll2
-rw-r--r--llvm/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll6
-rw-r--r--llvm/test/MC/MachO/file.s8
-rw-r--r--llvm/test/MC/MachO/gen-dwarf.s2
-rw-r--r--llvm/test/MC/MachO/loc.s12
8 files changed, 16 insertions, 28 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index 9574379d78d2..7093446815f3 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -462,14 +462,8 @@ MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params,
emitAbsValue(*MCOS,
MakeStartMinusEndExpr(*MCOS, *LineStartSym, *LineEndSym, 4), 4);
- unsigned LineTableVersion = context.getDwarfVersion();
-
- // On Darwin we default to v2 for anything before DWARF v5.
- if (context.getObjectFileInfo()->getTargetTriple().isOSDarwin() &&
- LineTableVersion < 5)
- LineTableVersion = 2;
-
// Next 2 bytes is the Version.
+ unsigned LineTableVersion = context.getDwarfVersion();
MCOS->EmitIntValue(LineTableVersion, 2);
// Keep track of the bytes between the very start and where the header length
diff --git a/llvm/test/CodeGen/Generic/dwarf-md5.ll b/llvm/test/CodeGen/Generic/dwarf-md5.ll
index c55d7d7725af..2fc25f3a3ed6 100644
--- a/llvm/test/CodeGen/Generic/dwarf-md5.ll
+++ b/llvm/test/CodeGen/Generic/dwarf-md5.ll
@@ -1,8 +1,5 @@
; MD5 checksums provided by IR should be passed through to asm.
; They'll be emitted to an object file only for DWARF 5 or later.
-;
-; Note that on Darwin for DWARF 4 or earlier, the line table version is clamped
-; to version 2. However that doesn't affect the output checked in this test.
; REQUIRES: object-emission
; RUN: %llc_dwarf -dwarf-version 4 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM-4
diff --git a/llvm/test/CodeGen/Generic/dwarf-source.ll b/llvm/test/CodeGen/Generic/dwarf-source.ll
index 7b7d9c59b76b..41441110f2f6 100644
--- a/llvm/test/CodeGen/Generic/dwarf-source.ll
+++ b/llvm/test/CodeGen/Generic/dwarf-source.ll
@@ -1,8 +1,5 @@
; Source text provided by IR should be passed through to asm.
; It is emitted to an object file only for DWARF 5 or later.
-;
-; Note that on Darwin for DWARF 4 or earlier, the line table version is clamped
-; to version 2. However that doesn't affect the output checked in this test.
; REQUIRES: object-emission
; RUN: %llc_dwarf -dwarf-version 4 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM-4
diff --git a/llvm/test/DebugInfo/X86/nodebug.ll b/llvm/test/DebugInfo/X86/nodebug.ll
index 2aff40146cdf..0eccb89c9da6 100644
--- a/llvm/test/DebugInfo/X86/nodebug.ll
+++ b/llvm/test/DebugInfo/X86/nodebug.ll
@@ -24,7 +24,7 @@
; Expect no line table entry since there are no functions and file references in this compile unit
; CHECK: .debug_line contents:
; CHECK: Line table prologue:
-; CHECK: total_length: 0x00000019
+; CHECK: total_length: 0x0000001a
; CHECK-NOT: file_names[
@i = external global i32
diff --git a/llvm/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll b/llvm/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll
index e37bcb6daaad..97f8b6cdab44 100644
--- a/llvm/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll
+++ b/llvm/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll
@@ -15,7 +15,7 @@
; CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000010)
; CHECK: DW_TAG_compile_unit
-; CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x0000003c)
+; CHECK: DW_AT_stmt_list [DW_FORM_sec_offset] (0x0000003d)
; CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000010)
; CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000009)
; CHECK: DW_TAG_subprogram
@@ -26,13 +26,13 @@
; CHECK: .debug_line contents:
; CHECK-NEXT: debug_line[{{.*}}]
; CHECK-NEXT: Line table prologue:
-; CHECK-NEXT: total_length: 0x00000038
+; CHECK-NEXT: total_length: 0x00000039
; CHECK: file_names[ 1]:
; CHECK-NEXT: name: "simple.c"
; CHECK-NEXT: dir_index: 0
; CHECK: debug_line[{{.*}}]
; CHECK-NEXT: Line table prologue:
-; CHECK-NEXT: total_length: 0x00000039
+; CHECK-NEXT: total_length: 0x0000003a
; CHECK: file_names[ 1]:
; CHECK-NEXT: name: "simple2.c"
; CHECK-NEXT: dir_index: 0
diff --git a/llvm/test/MC/MachO/file.s b/llvm/test/MC/MachO/file.s
index 0a871379c864..3ddfb2efe224 100644
--- a/llvm/test/MC/MachO/file.s
+++ b/llvm/test/MC/MachO/file.s
@@ -8,7 +8,7 @@
// CHECK-NEXT: Name: __debug_line
// CHECK-NEXT: Segment: __DWARF
// CHECK-NEXT: Address: 0x1
-// CHECK-NEXT: Size: 0x28
+// CHECK-NEXT: Size: 0x29
// CHECK-NEXT: Offset: 237
// CHECK-NEXT: Alignment: 0
// CHECK-NEXT: RelocationOffset: 0x0
@@ -20,8 +20,8 @@
// CHECK-NEXT: Reserved1: 0x0
// CHECK-NEXT: Reserved2: 0x0
// CHECK-NEXT: SectionData (
-// CHECK-NEXT: 0000: 24000000 02001E00 00000101 FB0E0D00 |$...............|
-// CHECK-NEXT: 0010: 01010101 00000001 00000164 69720000 |...........dir..|
-// CHECK-NEXT: 0020: 666F6F00 01000000 |foo.....|
+// CHECK-NEXT: 000: 25000000 04001F00 00000101 01FB0E0D |%...............|
+// CHECK-NEXT: 010: 00010101 01000000 01000001 64697200 |............dir.|
+// CHECK-NEXT: 020: 00666F6F 00010000 00 |.foo.....|
// CHECK-NEXT: )
// CHECK-NEXT: }
diff --git a/llvm/test/MC/MachO/gen-dwarf.s b/llvm/test/MC/MachO/gen-dwarf.s
index f567f79979f6..0813856d625f 100644
--- a/llvm/test/MC/MachO/gen-dwarf.s
+++ b/llvm/test/MC/MachO/gen-dwarf.s
@@ -89,7 +89,7 @@ _x: .long 1
// CHECK: .debug_line contents:
// CHECK: Line table prologue:
// We don't check the total_length as it includes lengths of temp paths
-// CHECK: version: 2
+// CHECK: version: 4
// We don't check the prologue_length as it too includes lengths of temp paths
// CHECK: min_inst_length: 1
// CHECK: default_is_stmt: 1
diff --git a/llvm/test/MC/MachO/loc.s b/llvm/test/MC/MachO/loc.s
index b3f1c2a875e7..ef4c815360c6 100644
--- a/llvm/test/MC/MachO/loc.s
+++ b/llvm/test/MC/MachO/loc.s
@@ -9,7 +9,7 @@
// CHECK: Name: __debug_line (5F 5F 64 65 62 75 67 5F 6C 69 6E 65 00 00 00 00)
// CHECK: Segment: __DWARF (5F 5F 44 57 41 52 46 00 00 00 00 00 00 00 00 00)
// CHECK: Address: 0x1
-// CHECK: Size: 0x3C
+// CHECK: Size: 0x3D
// CHECK: Offset: 237
// CHECK: Alignment: 0
// CHECK: RelocationOffset: 0x12C
@@ -21,15 +21,15 @@
// CHECK: Reserved1: 0x0
// CHECK: Reserved2: 0x0
// CHECK: SectionData (
-// CHECK: 0000: 38000000 02002100 00000101 FB0E0D00 |8.....!.........|
-// CHECK: 0010: 01010101 00000001 00000100 62617200 |............bar.|
-// CHECK: 0020: 00000066 6F6F0000 00000004 02000502 |...foo..........|
-// CHECK: 0030: 00000000 033F0102 01000101 |.....?......|
+// CHECK: 000: 39000000 04002200 00000101 01FB0E0D |9.....".........|
+// CHECK: 010: 00010101 01000000 01000001 00626172 |.............bar|
+// CHECK: 020: 00000000 666F6F00 00000000 04020005 |....foo.........|
+// CHECK: 030: 02000000 00033F01 02010001 01 |......?......|
// CHECK: )
// CHECK: }
// CHECK: ]
// CHECK: Relocations [
// CHECK: Section __debug_line {
-// CHECK: 0x30 0 2 0 GENERIC_RELOC_VANILLA 0 __text
+// CHECK: 0x31 0 2 0 GENERIC_RELOC_VANILLA 0 __text
// CHECK: }
// CHECK: ]