Skip to content

Bump the DWARF format to version 4 on Darwin. #4697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions include/swift/Basic/Dwarf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 1 addition & 3 deletions lib/FrontendTool/FrontendTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1181,9 +1181,7 @@ int swift::performFrontend(ArrayRef<const char *> 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) {
Expand Down
4 changes: 2 additions & 2 deletions test/DebugInfo/apple-types-accel.swift
Original file line number Diff line number Diff line change
@@ -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 <rdar://problem/28232630>: dwarfdump --verify %t.o
// REQUIRES: OS=macosx

// Verify that the unmangles basenames end up in the accelerator table.
Expand Down
2 changes: 1 addition & 1 deletion test/DebugInfo/basic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion test/DebugInfo/test-foundation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 <rdar://problem/28232630>: dwarfdump --verify %t.o

// REQUIRES: OS=macosx

Expand Down