Skip to content

Commit c3c5cc3

Browse files
committed
Frontend: Obsolete -fixit-all and -emit-fixits-path
With `ARCMigrate` and `arcmt-test` removed from clang in llvm/llvm-project#119269 and the new code migration experience under way (see swiftlang/swift-evolution#2673), these options are no longer relevant nor known to be in use. They were introduced long ago to support fix-it application in Xcode. For now, turn them into a no-op and emit a obsoletion warning.
1 parent d033eec commit c3c5cc3

15 files changed

+24
-1012
lines changed

include/swift/AST/DiagnosticsFrontend.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ ERROR(cannot_emit_ir_skipping_function_bodies,none,
193193
WARNING(emit_reference_dependencies_without_primary_file,none,
194194
"ignoring -emit-reference-dependencies (requires -primary-file)", ())
195195

196+
WARNING(ignoring_option_obsolete,none,
197+
"ignoring '%0'; this option is obsolete", (StringRef))
196198
WARNING(ignoring_option_requires_option,none,
197199
"ignoring %0 (requires %1)", (StringRef, StringRef))
198200
WARNING(warn_ignore_option_overriden_by,none,

lib/Frontend/ArgsToFrontendOutputsConverter.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,6 @@ SupplementaryOutputPathsComputer::getSupplementaryOutputPathsFromArguments()
317317
options::OPT_emit_reference_dependencies_path);
318318
auto serializedDiagnostics = getSupplementaryFilenamesFromArguments(
319319
options::OPT_serialize_diagnostics_path);
320-
auto fixItsOutput = getSupplementaryFilenamesFromArguments(
321-
options::OPT_emit_fixits_path);
322320
auto loadedModuleTrace = getSupplementaryFilenamesFromArguments(
323321
options::OPT_emit_loaded_module_trace_path);
324322
auto TBD = getSupplementaryFilenamesFromArguments(options::OPT_emit_tbd_path);
@@ -343,7 +341,7 @@ SupplementaryOutputPathsComputer::getSupplementaryOutputPathsFromArguments()
343341
options::OPT_save_optimization_record_path);
344342
if (!clangHeaderOutput || !moduleOutput || !moduleDocOutput ||
345343
!dependenciesFile || !referenceDependenciesFile ||
346-
!serializedDiagnostics || !fixItsOutput || !loadedModuleTrace || !TBD ||
344+
!serializedDiagnostics || !loadedModuleTrace || !TBD ||
347345
!moduleInterfaceOutput || !privateModuleInterfaceOutput || !packageModuleInterfaceOutput ||
348346
!moduleSourceInfoOutput || !moduleSummaryOutput || !abiDescriptorOutput ||
349347
!moduleSemanticInfoOutput || !optRecordOutput) {
@@ -361,7 +359,6 @@ SupplementaryOutputPathsComputer::getSupplementaryOutputPathsFromArguments()
361359
sop.DependenciesFilePath = (*dependenciesFile)[i];
362360
sop.ReferenceDependenciesFilePath = (*referenceDependenciesFile)[i];
363361
sop.SerializedDiagnosticsPath = (*serializedDiagnostics)[i];
364-
sop.FixItsOutputPath = (*fixItsOutput)[i];
365362
sop.LoadedModuleTracePath = (*loadedModuleTrace)[i];
366363
sop.TBDPath = (*TBD)[i];
367364
sop.ModuleInterfaceOutputPath = (*moduleInterfaceOutput)[i];

lib/Frontend/CompilerInvocation.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2548,7 +2548,20 @@ static bool ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
25482548
Opts.EmitMacroExpansionFiles = !negated;
25492549
}
25502550

2551-
Opts.FixitCodeForAllDiagnostics |= Args.hasArg(OPT_fixit_all);
2551+
{
2552+
OptSpecifier obsoleteOpts[] = {
2553+
OPT_fixit_all,
2554+
OPT_emit_fixits_path,
2555+
};
2556+
2557+
for (auto option: obsoleteOpts) {
2558+
if (auto *arg = Args.getLastArg(option)) {
2559+
Diags.diagnose(SourceLoc(), diag::ignoring_option_obsolete,
2560+
arg->getOption().getPrefixedName());
2561+
}
2562+
}
2563+
}
2564+
25522565
Opts.SuppressWarnings |= Args.hasArg(OPT_suppress_warnings);
25532566
Opts.SuppressRemarks |= Args.hasArg(OPT_suppress_remarks);
25542567
for (const Arg *arg : Args.filtered(OPT_warning_treating_Group)) {

test/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@ function(get_test_dependencies SDK result_var_name)
114114

115115
if(NOT SWIFT_BUILT_STANDALONE)
116116
list(APPEND deps_binaries
117-
arcmt-test
118-
c-arcmt-test
119117
c-index-test
120118
CASPluginTest
121119
clang

test/FixCode/batch-mode.swift

Lines changed: 0 additions & 24 deletions
This file was deleted.

test/FixCode/fixit-all.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-frontend -typecheck -fixit-all -emit-fixits-path %t.remap %s 2>&1 | %FileCheck %s
3+
4+
// CHECK: <unknown>:0: warning: ignoring '-fixit-all'; this option is obsolete
5+
// CHECK: <unknown>:0: warning: ignoring '-emit-fixits-path'; this option is obsolete

test/FixCode/fixits-apply-all.swift

Lines changed: 0 additions & 26 deletions
This file was deleted.

test/FixCode/fixits-apply-all.swift.result

Lines changed: 0 additions & 26 deletions
This file was deleted.

test/FixCode/fixits-apply-objc.swift

Lines changed: 0 additions & 111 deletions
This file was deleted.

test/FixCode/fixits-apply-objc.swift.result

Lines changed: 0 additions & 111 deletions
This file was deleted.

0 commit comments

Comments
 (0)