Skip to content

Commit

Permalink
Merge pull request #4697 from adrian-prantl/28231982
Browse files Browse the repository at this point in the history
Bump the DWARF format to version 4 on Darwin.
  • Loading branch information
adrian-prantl authored Sep 13, 2016
2 parents d88e003 + 9f060dc commit d0f16bf
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
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 @@ -1182,9 +1182,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

0 comments on commit d0f16bf

Please sign in to comment.