Skip to content

Commit 9f060dc

Browse files
committed
Bump the DWARF format to version 4 on all platforms.
This unifies the output across all supported platforms and brings swiftc in sync with clang. <rdar://problem/28231982>
1 parent b3030fc commit 9f060dc

File tree

5 files changed

+6
-9
lines changed

5 files changed

+6
-9
lines changed

include/swift/Basic/Dwarf.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121

2222
namespace swift {
2323
/// The DWARF version emitted by the Swift compiler.
24-
const unsigned GenericDWARFVersion = 3;
25-
const unsigned CygwinDWARFVersion = 4;
24+
const unsigned DWARFVersion = 4;
2625

2726
static const char MachOASTSegmentName[] = "__SWIFT";
2827
static const char MachOASTSectionName[] = "__ast";

lib/FrontendTool/FrontendTool.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,9 +1181,7 @@ int swift::performFrontend(ArrayRef<const char *> Args,
11811181

11821182
// Setting DWARF Version depend on platform
11831183
IRGenOptions &IRGenOpts = Invocation.getIRGenOptions();
1184-
IRGenOpts.DWARFVersion = swift::GenericDWARFVersion;
1185-
if (Invocation.getLangOptions().Target.isWindowsCygwinEnvironment())
1186-
IRGenOpts.DWARFVersion = swift::CygwinDWARFVersion;
1184+
IRGenOpts.DWARFVersion = swift::DWARFVersion;
11871185

11881186
// The compiler invocation is now fully configured; notify our observer.
11891187
if (observer) {

test/DebugInfo/apple-types-accel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %target-swift-frontend %s -emit-ir -g -o - | %FileCheck %s
22
// RUN: %target-swift-frontend %s -c -g -o %t.o
3-
// RUN: dwarfdump --verify --apple-types %t.o | %FileCheck --check-prefix=CHECK-ACCEL %s
3+
// RUN: dwarfdump --apple-types %t.o | %FileCheck --check-prefix=CHECK-ACCEL %s
44
// RUN: dwarfdump --debug-info %t.o | %FileCheck --check-prefix=CHECK-DWARF %s
5-
5+
// DISABLED <rdar://problem/28232630>: dwarfdump --verify %t.o
66
// REQUIRES: OS=macosx
77

88
// Verify that the unmangles basenames end up in the accelerator table.

test/DebugInfo/basic.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func foo(_ a: Int64, _ b: Int64) -> Int64 {
8181
// CHECK-DAG: ![[MAINMODULE]] = !DIModule({{.*}}, name: "basic"
8282

8383
// DWARF Version
84-
// CHECK-DAG: i32 2, !"Dwarf Version", i32 3}
84+
// CHECK-DAG: i32 2, !"Dwarf Version", i32 4}
8585

8686
// Debug Info Version
8787
// CHECK-DAG: i32 2, !"Debug Info Version", i32

test/DebugInfo/test-foundation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %FileCheck %s --check-prefix LOC-CHECK < %t.ll
44
// RUN: llc %t.ll -filetype=obj -o %t.o
55
// RUN: llvm-dwarfdump %t.o | %FileCheck %s --check-prefix DWARF-CHECK
6-
// RUN: dwarfdump --verify %t.o
6+
// DISABLED <rdar://problem/28232630>: dwarfdump --verify %t.o
77

88
// REQUIRES: OS=macosx
99

0 commit comments

Comments
 (0)