@@ -1055,7 +1055,12 @@ extension Driver {
1055
1055
case . emitImportedModules:
1056
1056
return . singleCompile
1057
1057
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:
1059
1064
return . repl
1060
1065
1061
1066
case . deprecatedIntegratedRepl:
@@ -1120,6 +1125,10 @@ extension Driver {
1120
1125
}
1121
1126
1122
1127
extension 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
+
1123
1132
static func warn_ignoring_batch_mode( _ option: Option ) -> Diagnostic . Message {
1124
1133
. warning( " ignoring '-enable-batch-mode' because ' \( option. spelling) ' was also specified " )
1125
1134
}
@@ -1252,7 +1261,7 @@ extension Driver {
1252
1261
compilerOutputType = nil
1253
1262
1254
1263
case . i:
1255
- diagnosticsEngine. emit ( . error_i_mode( driverKind ) )
1264
+ diagnosticsEngine. emit ( . error_i_mode)
1256
1265
1257
1266
case . repl, . deprecatedIntegratedRepl, . lldbRepl:
1258
1267
compilerOutputType = nil
@@ -1291,11 +1300,11 @@ extension Driver {
1291
1300
}
1292
1301
1293
1302
extension Diagnostic . Message {
1294
- static func error_i_mode( _ driverKind : DriverKind ) -> Diagnostic . Message {
1303
+ static var error_i_mode : Diagnostic . Message {
1295
1304
. error(
1296
1305
"""
1297
1306
the flag '-i' is no longer required and has been removed; \
1298
- use ' \( driverKind . usage) input-filename'
1307
+ use ' \( DriverKind . interactive . usage) input-filename'
1299
1308
"""
1300
1309
)
1301
1310
}
@@ -1424,7 +1433,8 @@ extension Driver {
1424
1433
1425
1434
if format == . codeView && ( level == . lineTables || level == . dwarfTypes) {
1426
1435
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) )
1428
1438
}
1429
1439
1430
1440
return DebugInfo ( format: format, level: level, shouldVerify: shouldVerify)
0 commit comments