@@ -1051,7 +1051,12 @@ extension Driver {
1051
1051
case . emitImportedModules:
1052
1052
return . singleCompile
1053
1053
1054
- case . repl, . lldbRepl:
1054
+ case . repl:
1055
+ if driverKind == . interactive, !parsedOptions. hasAnyInput {
1056
+ diagnosticsEngine. emit ( . warning_unnecessary_repl_mode( option: outputOption. option, kind: driverKind) )
1057
+ }
1058
+ fallthrough
1059
+ case . lldbRepl:
1055
1060
return . repl
1056
1061
1057
1062
case . deprecatedIntegratedRepl:
@@ -1116,6 +1121,10 @@ extension Driver {
1116
1121
}
1117
1122
1118
1123
extension Diagnostic . Message {
1124
+ static func warning_unnecessary_repl_mode( option: Option , kind: DriverKind ) -> Diagnostic . Message {
1125
+ . warning( " unnecessary option ' \( option. spelling) '; this is the default for ' \( kind. rawValue) ' with no input files " )
1126
+ }
1127
+
1119
1128
static func warn_ignoring_batch_mode( _ option: Option ) -> Diagnostic . Message {
1120
1129
. warning( " ignoring '-enable-batch-mode' because ' \( option. spelling) ' was also specified " )
1121
1130
}
@@ -1248,7 +1257,7 @@ extension Driver {
1248
1257
compilerOutputType = nil
1249
1258
1250
1259
case . i:
1251
- diagnosticsEngine. emit ( . error_i_mode( driverKind ) )
1260
+ diagnosticsEngine. emit ( . error_i_mode)
1252
1261
1253
1262
case . repl, . deprecatedIntegratedRepl, . lldbRepl:
1254
1263
compilerOutputType = nil
@@ -1287,11 +1296,11 @@ extension Driver {
1287
1296
}
1288
1297
1289
1298
extension Diagnostic . Message {
1290
- static func error_i_mode( _ driverKind : DriverKind ) -> Diagnostic . Message {
1299
+ static var error_i_mode : Diagnostic . Message {
1291
1300
. error(
1292
1301
"""
1293
1302
the flag '-i' is no longer required and has been removed; \
1294
- use ' \( driverKind . usage) input-filename'
1303
+ use ' \( DriverKind . interactive . usage) input-filename'
1295
1304
"""
1296
1305
)
1297
1306
}
@@ -1420,7 +1429,8 @@ extension Driver {
1420
1429
1421
1430
if format == . codeView && ( level == . lineTables || level == . dwarfTypes) {
1422
1431
let levelOption = parsedOptions. getLast ( in: . g) !. option
1423
- diagnosticsEngine. emit ( . error_argument_not_allowed_with( arg: format. rawValue, other: levelOption. spelling) )
1432
+ let fullNotAllowedOption = Option . debugInfoFormat. spelling + format. rawValue
1433
+ diagnosticsEngine. emit ( . error_argument_not_allowed_with( arg: fullNotAllowedOption, other: levelOption. spelling) )
1424
1434
}
1425
1435
1426
1436
return DebugInfo ( format: format, level: level, shouldVerify: shouldVerify)
0 commit comments