Skip to content

Commit 3c99ffc

Browse files
committed
Remove code using .noDriver arguments
1 parent 7426a74 commit 3c99ffc

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

Sources/SwiftDriver/Driver/Driver.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ extension Driver {
10481048
// Some output flags affect the compiler mode.
10491049
if let outputOption = parsedOptions.getLast(in: .modes) {
10501050
switch outputOption.option {
1051-
case .emitPch, .emitImportedModules:
1051+
case .emitImportedModules:
10521052
return .singleCompile
10531053

10541054
case .repl, .lldbRepl:
@@ -1090,8 +1090,6 @@ extension Driver {
10901090
parsedOptions.eraseArgument(.indexFile)
10911091
parsedOptions.eraseArgument(.indexFilePath)
10921092
parsedOptions.eraseArgument(.indexStorePath)
1093-
parsedOptions.eraseArgument(.indexIgnoreStdlib)
1094-
parsedOptions.eraseArgument(.indexSystemModules)
10951093
parsedOptions.eraseArgument(.indexIgnoreSystemModules)
10961094
return .standardCompile
10971095
}
@@ -1231,9 +1229,6 @@ extension Driver {
12311229
case .dumpAst:
12321230
compilerOutputType = .ast
12331231

1234-
case .emitPch:
1235-
compilerOutputType = .pch
1236-
12371232
case .emitPcm:
12381233
compilerOutputType = .pcm
12391234

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,7 @@ final class SwiftDriverTests: XCTestCase {
15581558

15591559
func testMergeModulesOnly() throws {
15601560
do {
1561-
var driver = try Driver(args: ["swiftc", "foo.swift", "bar.swift", "-module-name", "Test", "-emit-module", "-disable-bridging-pch", "-import-objc-header", "TestInputHeader.h", "-emit-dependencies", "-emit-module-doc-path", "/foo/bar/Test.swiftdoc", "-emit-module-source-info-path", "/foo/bar/Test.swiftsourceinfo"])
1561+
var driver = try Driver(args: ["swiftc", "foo.swift", "bar.swift", "-module-name", "Test", "-emit-module", "-disable-bridging-pch", "-import-objc-header", "TestInputHeader.h", "-emit-dependencies", "-emit-module-source-info-path", "/foo/bar/Test.swiftsourceinfo"])
15621562
let plannedJobs = try driver.planBuild()
15631563
XCTAssertEqual(plannedJobs.count, 3)
15641564
XCTAssertEqual(plannedJobs[0].outputs.count, 4)
@@ -1578,7 +1578,7 @@ final class SwiftDriverTests: XCTestCase {
15781578
XCTAssertTrue(plannedJobs[2].tool.name.contains("swift"))
15791579
XCTAssertEqual(plannedJobs[2].outputs.count, 3)
15801580
XCTAssertEqual(plannedJobs[2].outputs[0].file, .relative(RelativePath("Test.swiftmodule")))
1581-
XCTAssertEqual(plannedJobs[2].outputs[1].file, .absolute(AbsolutePath("/foo/bar/Test.swiftdoc")))
1581+
XCTAssertEqual(plannedJobs[2].outputs[1].file, .relative(RelativePath("Test.swiftdoc")))
15821582
XCTAssertEqual(plannedJobs[2].outputs[2].file, .absolute(AbsolutePath("/foo/bar/Test.swiftsourceinfo")))
15831583
XCTAssert(plannedJobs[2].commandLine.contains(.flag("-import-objc-header")))
15841584
}
@@ -1608,7 +1608,7 @@ final class SwiftDriverTests: XCTestCase {
16081608

16091609
do {
16101610
// Make sure the swiftdoc path is correct for an inferred module
1611-
var driver = try Driver(args: ["swiftc", "foo.swift", "bar.swift", "-module-name", "Test", "-emit-module-doc", "-emit-module"])
1611+
var driver = try Driver(args: ["swiftc", "foo.swift", "bar.swift", "-module-name", "Test", "-emit-module"])
16121612
let plannedJobs = try driver.planBuild()
16131613
XCTAssertEqual(plannedJobs.count, 3)
16141614
XCTAssertTrue(plannedJobs[2].tool.name.contains("swift"))
@@ -2714,7 +2714,6 @@ final class SwiftDriverTests: XCTestCase {
27142714
"foo.swift",
27152715
"-index-file-path", "foo.swift",
27162716
"-index-store-path", "store/path",
2717-
"-index-ignore-stdlib", "-index-system-modules",
27182717
"-index-ignore-system-modules"]) {
27192718
$1.expect(.warning("ignoring '-index-file' because '-dump-ast' was also specified"))
27202719
let jobs = try $0.planBuild()
@@ -3805,15 +3804,6 @@ final class SwiftDriverTests: XCTestCase {
38053804
}
38063805

38073806
func testSourceInfoFileEmitOption() throws {
3808-
do {
3809-
var driver = try Driver(args: ["swiftc", "-emit-module-source-info", "foo.swift"])
3810-
let plannedJobs = try driver.planBuild()
3811-
let compileJob = plannedJobs[0]
3812-
XCTAssertTrue(compileJob.commandLine.contains(.flag("-emit-module-source-info-path")))
3813-
XCTAssertEqual(compileJob.outputs.count, 2)
3814-
XCTAssertEqual(compileJob.outputs[0].file, .temporary(RelativePath("foo.o")))
3815-
XCTAssertEqual(compileJob.outputs[1].file, .temporary(RelativePath("foo.swiftsourceinfo")))
3816-
}
38173807
// implicit
38183808
do {
38193809
var driver = try Driver(args: ["swiftc", "-emit-module", "foo.swift"])

0 commit comments

Comments
 (0)