diff --git a/Sources/SwiftDriver/Driver/Driver.swift b/Sources/SwiftDriver/Driver/Driver.swift index e43a9234d..f6f74a708 100644 --- a/Sources/SwiftDriver/Driver/Driver.swift +++ b/Sources/SwiftDriver/Driver/Driver.swift @@ -1048,7 +1048,7 @@ extension Driver { // Some output flags affect the compiler mode. if let outputOption = parsedOptions.getLast(in: .modes) { switch outputOption.option { - case .emitPch, .emitImportedModules: + case .emitImportedModules: return .singleCompile case .repl, .lldbRepl: @@ -1090,8 +1090,6 @@ extension Driver { parsedOptions.eraseArgument(.indexFile) parsedOptions.eraseArgument(.indexFilePath) parsedOptions.eraseArgument(.indexStorePath) - parsedOptions.eraseArgument(.indexIgnoreStdlib) - parsedOptions.eraseArgument(.indexSystemModules) parsedOptions.eraseArgument(.indexIgnoreSystemModules) return .standardCompile } @@ -1231,9 +1229,6 @@ extension Driver { case .dumpAst: compilerOutputType = .ast - case .emitPch: - compilerOutputType = .pch - case .emitPcm: compilerOutputType = .pcm diff --git a/Sources/SwiftOptions/Option.swift b/Sources/SwiftOptions/Option.swift index e98a8e237..5535d8b6f 100644 --- a/Sources/SwiftOptions/Option.swift +++ b/Sources/SwiftOptions/Option.swift @@ -135,9 +135,9 @@ extension Option { public func isAccepted(by driverKind: DriverKind) -> Bool { switch driverKind { case .batch: - return !attributes.contains(.noBatch) + return attributes.isDisjoint(with: [.noDriver, .noBatch]) case .interactive: - return !attributes.contains(.noInteractive) + return attributes.isDisjoint(with: [.noDriver, .noInteractive]) } } } diff --git a/Sources/SwiftOptions/OptionParsing.swift b/Sources/SwiftOptions/OptionParsing.swift index e441cd46f..50ef7b40d 100644 --- a/Sources/SwiftOptions/OptionParsing.swift +++ b/Sources/SwiftOptions/OptionParsing.swift @@ -38,7 +38,8 @@ extension OptionTable { public func parse(_ arguments: [String], for driverKind: DriverKind) throws -> ParsedOptions { var trie = PrefixTrie