Skip to content

Commit 94317a7

Browse files
authored
Merge pull request #1473 from apple/revert-1467-dwarf-version
Revert "Make the DWARF version configurable."
2 parents 1f28d63 + d87b791 commit 94317a7

File tree

5 files changed

+2
-31
lines changed

5 files changed

+2
-31
lines changed

Sources/SwiftDriver/Driver/DebugInfo.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,9 @@
4141
}
4242
}
4343

44-
/// The format of debug information.
44+
// The format of debug information.
4545
public let format: Format
4646

47-
/// The DWARF standard version to be produced.
48-
public let dwarfVersion: UInt8
49-
5047
/// The level of debug information.
5148
public let level: Level?
5249

Sources/SwiftDriver/Driver/Driver.swift

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2308,17 +2308,7 @@ extension Driver {
23082308
diagnosticsEngine.emit(.error_argument_not_allowed_with(arg: fullNotAllowedOption, other: levelOption.spelling))
23092309
}
23102310

2311-
// Determine the DWARF version.
2312-
var dwarfVersion: UInt8 = 4
2313-
if let versionArg = parsedOptions.getLastArgument(.dwarfVersion) {
2314-
if let parsedVersion = UInt8(versionArg.asSingle), parsedVersion >= 2 && parsedVersion <= 5 {
2315-
dwarfVersion = parsedVersion
2316-
} else {
2317-
diagnosticsEngine.emit(.error_invalid_arg_value(arg: .dwarfVersion, value: versionArg.asSingle))
2318-
}
2319-
}
2320-
2321-
return DebugInfo(format: format, dwarfVersion: dwarfVersion, level: level, shouldVerify: shouldVerify)
2311+
return DebugInfo(format: format, level: level, shouldVerify: shouldVerify)
23222312
}
23232313

23242314
/// Parses the set of `-sanitize={sanitizer}` arguments and returns all the

Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ extension Driver {
193193
try commandLine.appendLast(.enablePrivateImports, from: &parsedOptions)
194194
try commandLine.appendLast(in: .g, from: &parsedOptions)
195195
try commandLine.appendLast(.debugInfoFormat, from: &parsedOptions)
196-
try commandLine.appendLast(.dwarfVersion, from: &parsedOptions)
197196
try commandLine.appendLast(.importUnderlyingModule, from: &parsedOptions)
198197
try commandLine.appendLast(.moduleCachePath, from: &parsedOptions)
199198
try commandLine.appendLast(.moduleLinkName, from: &parsedOptions)

Sources/SwiftOptions/Options.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ extension Option {
111111
public static let debugForbidTypecheckPrefix: Option = Option("-debug-forbid-typecheck-prefix", .separate, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Triggers llvm fatal_error if typechecker tries to typecheck a decl with the provided prefix name")
112112
public static let debugGenericSignatures: Option = Option("-debug-generic-signatures", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Debug generic signatures")
113113
public static let debugInfoFormat: Option = Option("-debug-info-format=", .joined, attributes: [.frontend], helpText: "Specify the debug info format type to either 'dwarf' or 'codeview'")
114-
public static let dwarfVersion: Option = Option("-dwarf-version=", .joined, attributes: [.frontend], helpText: "DWARF debug info version to produce if requested")
115114
public static let debugInfoStoreInvocation: Option = Option("-debug-info-store-invocation", .flag, attributes: [.frontend], helpText: "Emit the compiler invocation in the debug info.")
116115
public static let debugMapping: Option = Option("-debug-mapping", .flag, attributes: [.noDriver], helpText: "Dumping information for debug purposes")
117116
public static let debugMapping_: Option = Option("--debug-mapping", .flag, alias: Option.debugMapping, attributes: [.noDriver], helpText: "Dumping information for debug purposes")
@@ -929,7 +928,6 @@ extension Option {
929928
Option.debugForbidTypecheckPrefix,
930929
Option.debugGenericSignatures,
931930
Option.debugInfoFormat,
932-
Option.dwarfVersion,
933931
Option.debugInfoStoreInvocation,
934932
Option.debugMapping,
935933
Option.debugMapping_,

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -574,19 +574,6 @@ final class SwiftDriverTests: XCTestCase {
574574
$1.expect(.error("argument '-debug-info-format=codeview' is not allowed with '-gdwarf-types'"))
575575
}
576576

577-
try assertDriverDiagnostics(args: "swiftc", "foo.swift", "-emit-module", "-dwarf-version=0") {
578-
$1.expect(.error("invalid value '0' in '-dwarf-version="))
579-
}
580-
581-
try assertDriverDiagnostics(args: "swiftc", "foo.swift", "-emit-module", "-dwarf-version=6") {
582-
$1.expect(.error("invalid value '6' in '-dwarf-version="))
583-
}
584-
585-
try assertNoDriverDiagnostics(args: "swiftc", "foo.swift", "-emit-module", "-g", "-debug-info-format=dwarf", "-dwarf-version=4") { driver in
586-
let jobs = try driver.planBuild()
587-
XCTAssertTrue(jobs[0].commandLine.contains(.flag("-dwarf-version=4")))
588-
}
589-
590577
try assertNoDriverDiagnostics(args: "swiftc", "foo.swift", "-g", "-c", "-file-compilation-dir", ".") { driver in
591578
let jobs = try driver.planBuild()
592579
XCTAssertTrue(jobs[0].commandLine.contains(.flag("-file-compilation-dir")))

0 commit comments

Comments
 (0)