From 9f060dc5b7703aacf6349b56ebd459772855f417 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Fri, 9 Sep 2016 15:02:39 -0700 Subject: [PATCH] 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. --- include/swift/Basic/Dwarf.h | 3 +-- lib/FrontendTool/FrontendTool.cpp | 4 +--- test/DebugInfo/apple-types-accel.swift | 4 ++-- test/DebugInfo/basic.swift | 2 +- test/DebugInfo/test-foundation.swift | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/include/swift/Basic/Dwarf.h b/include/swift/Basic/Dwarf.h index 238432ad8be05..a962c8638cabc 100644 --- a/include/swift/Basic/Dwarf.h +++ b/include/swift/Basic/Dwarf.h @@ -21,8 +21,7 @@ namespace swift { /// The DWARF version emitted by the Swift compiler. - const unsigned GenericDWARFVersion = 3; - const unsigned CygwinDWARFVersion = 4; + const unsigned DWARFVersion = 4; static const char MachOASTSegmentName[] = "__SWIFT"; static const char MachOASTSectionName[] = "__ast"; diff --git a/lib/FrontendTool/FrontendTool.cpp b/lib/FrontendTool/FrontendTool.cpp index 27e0f09a22323..69b93dbc78c6a 100644 --- a/lib/FrontendTool/FrontendTool.cpp +++ b/lib/FrontendTool/FrontendTool.cpp @@ -1181,9 +1181,7 @@ int swift::performFrontend(ArrayRef Args, // Setting DWARF Version depend on platform IRGenOptions &IRGenOpts = Invocation.getIRGenOptions(); - IRGenOpts.DWARFVersion = swift::GenericDWARFVersion; - if (Invocation.getLangOptions().Target.isWindowsCygwinEnvironment()) - IRGenOpts.DWARFVersion = swift::CygwinDWARFVersion; + IRGenOpts.DWARFVersion = swift::DWARFVersion; // The compiler invocation is now fully configured; notify our observer. if (observer) { diff --git a/test/DebugInfo/apple-types-accel.swift b/test/DebugInfo/apple-types-accel.swift index dc2b4ee49a42a..910cc97e47d98 100644 --- a/test/DebugInfo/apple-types-accel.swift +++ b/test/DebugInfo/apple-types-accel.swift @@ -1,8 +1,8 @@ // RUN: %target-swift-frontend %s -emit-ir -g -o - | %FileCheck %s // RUN: %target-swift-frontend %s -c -g -o %t.o -// RUN: dwarfdump --verify --apple-types %t.o | %FileCheck --check-prefix=CHECK-ACCEL %s +// RUN: dwarfdump --apple-types %t.o | %FileCheck --check-prefix=CHECK-ACCEL %s // RUN: dwarfdump --debug-info %t.o | %FileCheck --check-prefix=CHECK-DWARF %s - +// DISABLED : dwarfdump --verify %t.o // REQUIRES: OS=macosx // Verify that the unmangles basenames end up in the accelerator table. diff --git a/test/DebugInfo/basic.swift b/test/DebugInfo/basic.swift index 9028feacb5767..4309a93058812 100644 --- a/test/DebugInfo/basic.swift +++ b/test/DebugInfo/basic.swift @@ -81,7 +81,7 @@ func foo(_ a: Int64, _ b: Int64) -> Int64 { // CHECK-DAG: ![[MAINMODULE]] = !DIModule({{.*}}, name: "basic" // DWARF Version -// CHECK-DAG: i32 2, !"Dwarf Version", i32 3} +// CHECK-DAG: i32 2, !"Dwarf Version", i32 4} // Debug Info Version // CHECK-DAG: i32 2, !"Debug Info Version", i32 diff --git a/test/DebugInfo/test-foundation.swift b/test/DebugInfo/test-foundation.swift index c09ce3635dce1..1ef0170003f42 100644 --- a/test/DebugInfo/test-foundation.swift +++ b/test/DebugInfo/test-foundation.swift @@ -3,7 +3,7 @@ // RUN: %FileCheck %s --check-prefix LOC-CHECK < %t.ll // RUN: llc %t.ll -filetype=obj -o %t.o // RUN: llvm-dwarfdump %t.o | %FileCheck %s --check-prefix DWARF-CHECK -// RUN: dwarfdump --verify %t.o +// DISABLED : dwarfdump --verify %t.o // REQUIRES: OS=macosx