Skip to content

Commit c3b1e97

Browse files
Merge pull request #81358 from AnthonyLatsis/arachnocampa-luminosa-6.2
[6.2] Cherry-pick "Frontend: Obsolete `-fixit-all` and `-emit-fixits-path`"
2 parents 9bd0a34 + 012675b commit c3b1e97

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+478
-1094
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
@@ -2550,7 +2550,20 @@ static bool ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
25502550
Opts.EmitMacroExpansionFiles = !negated;
25512551
}
25522552

2553-
Opts.FixitCodeForAllDiagnostics |= Args.hasArg(OPT_fixit_all);
2553+
{
2554+
OptSpecifier obsoleteOpts[] = {
2555+
OPT_fixit_all,
2556+
OPT_emit_fixits_path,
2557+
};
2558+
2559+
for (auto option: obsoleteOpts) {
2560+
if (auto *arg = Args.getLastArg(option)) {
2561+
Diags.diagnose(SourceLoc(), diag::ignoring_option_obsolete,
2562+
arg->getOption().getPrefixedName());
2563+
}
2564+
}
2565+
}
2566+
25542567
Opts.SuppressWarnings |= Args.hasArg(OPT_suppress_warnings);
25552568
Opts.SuppressRemarks |= Args.hasArg(OPT_suppress_remarks);
25562569
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/Constraints/argument_matching.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,3 +1821,12 @@ struct Issue75527 {
18211821
fn(0) // Make sure the argument label does not escape here.
18221822
}
18231823
}
1824+
1825+
do {
1826+
func f(p: Int, _: String) {}
1827+
// FIXME: Wrong expected argument type.
1828+
// expected-error@+2:5 {{cannot convert value of type 'Int' to expected argument type 'String'}}
1829+
// expected-error@+1:8 {{cannot convert value of type 'String' to expected argument type 'Int'}}
1830+
f(0, "")
1831+
// expected-error@-1:4 {{missing argument label 'p:' in call}}{{5-5=p: }}
1832+
}

test/Constraints/bridging.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,28 @@ func forceUniversalBridgeToAnyObject<T, U: KnownClassProtocol>(a: T, b: U, c: An
367367
_ = z
368368
}
369369

370+
do {
371+
func f(an : Any, oan: Any?) -> AnyObject? {
372+
let a1 : AnyObject
373+
a1 = an
374+
// expected-error@-1:8 {{value of type 'Any' expected to be an instance of a class or class-constrained type in assignment}}{{none}}
375+
// expected-note@-2:8 {{cast 'Any' to 'AnyObject' or use 'as!' to force downcast to a more specific type to access members}}{{12-12= as AnyObject}}
376+
let a2 : AnyObject?
377+
a2 = an
378+
// expected-error@-1:10 {{value of type 'Any' expected to be an instance of a class or class-constrained type in assignment}}{{12-12= as AnyObject}}
379+
let a3 : AnyObject!
380+
a3 = an
381+
// expected-error@-1:10 {{value of type 'Any' expected to be an instance of a class or class-constrained type in assignment}}{{12-12= as AnyObject}}
382+
383+
let obj: AnyObject = an
384+
// expected-error@-1:26 {{value of type 'Any' expected to be instance of class or class-constrained type}}{{none}}
385+
// expected-note@-2:26 {{cast 'Any' to 'AnyObject' or use 'as!' to force downcast to a more specific type to access members}}{{28-28= as AnyObject}}
386+
387+
return oan
388+
// expected-error@-1:12 {{return expression of type 'Any' expected to be an instance of a class or class-constrained type}}{{15-15= as AnyObject}}
389+
}
390+
}
391+
370392
func bridgeAnyContainerToAnyObject(x: [Any], y: [NSObject: Any]) {
371393
var z: AnyObject
372394
z = x as AnyObject

test/FixCode/Inputs/batch-mode-helper.swift

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

test/FixCode/Inputs/module.modulemap

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/FixCode/Inputs/t1.swift

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

test/FixCode/Inputs/t1.swift.result

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

test/FixCode/Inputs/t2.swift

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

test/FixCode/Inputs/t2.swift.result

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

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.

0 commit comments

Comments
 (0)