@@ -1055,7 +1055,12 @@ extension Driver {
10551055 case . emitImportedModules:
10561056 return . singleCompile
10571057
1058- case . repl, . lldbRepl:
1058+ case . repl:
1059+ if driverKind == . interactive, !parsedOptions. hasAnyInput {
1060+ diagnosticsEngine. emit ( . warning_unnecessary_repl_mode( option: outputOption. option, kind: driverKind) )
1061+ }
1062+ fallthrough
1063+ case . lldbRepl:
10591064 return . repl
10601065
10611066 case . deprecatedIntegratedRepl:
@@ -1120,6 +1125,10 @@ extension Driver {
11201125}
11211126
11221127extension Diagnostic . Message {
1128+ static func warning_unnecessary_repl_mode( option: Option , kind: DriverKind ) -> Diagnostic . Message {
1129+ . warning( " unnecessary option ' \( option. spelling) '; this is the default for ' \( kind. rawValue) ' with no input files " )
1130+ }
1131+
11231132 static func warn_ignoring_batch_mode( _ option: Option ) -> Diagnostic . Message {
11241133 . warning( " ignoring '-enable-batch-mode' because ' \( option. spelling) ' was also specified " )
11251134 }
@@ -1252,7 +1261,7 @@ extension Driver {
12521261 compilerOutputType = nil
12531262
12541263 case . i:
1255- diagnosticsEngine. emit ( . error_i_mode( driverKind ) )
1264+ diagnosticsEngine. emit ( . error_i_mode)
12561265
12571266 case . repl, . deprecatedIntegratedRepl, . lldbRepl:
12581267 compilerOutputType = nil
@@ -1291,11 +1300,11 @@ extension Driver {
12911300}
12921301
12931302extension Diagnostic . Message {
1294- static func error_i_mode( _ driverKind : DriverKind ) -> Diagnostic . Message {
1303+ static var error_i_mode : Diagnostic . Message {
12951304 . error(
12961305 """
12971306 the flag '-i' is no longer required and has been removed; \
1298- use ' \( driverKind . usage) input-filename'
1307+ use ' \( DriverKind . interactive . usage) input-filename'
12991308 """
13001309 )
13011310 }
@@ -1424,7 +1433,8 @@ extension Driver {
14241433
14251434 if format == . codeView && ( level == . lineTables || level == . dwarfTypes) {
14261435 let levelOption = parsedOptions. getLast ( in: . g) !. option
1427- diagnosticsEngine. emit ( . error_argument_not_allowed_with( arg: format. rawValue, other: levelOption. spelling) )
1436+ let fullNotAllowedOption = Option . debugInfoFormat. spelling + format. rawValue
1437+ diagnosticsEngine. emit ( . error_argument_not_allowed_with( arg: fullNotAllowedOption, other: levelOption. spelling) )
14281438 }
14291439
14301440 return DebugInfo ( format: format, level: level, shouldVerify: shouldVerify)
0 commit comments