Skip to content

Commit b2c0a52

Browse files
authored
Merge pull request swiftlang#25713 from slavapestov/bring-back-old-flag
Revert "Frontend: Remove -enable-resilience flag"
2 parents bad0348 + e1e0984 commit b2c0a52

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

include/swift/Option/FrontendOptions.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ def disable_objc_attr_requires_foundation_module :
171171
HelpText<"Disable requiring uses of @objc to require importing the "
172172
"Foundation module">;
173173

174+
def enable_resilience : Flag<["-"], "enable-resilience">,
175+
HelpText<"Deprecated, use -enable-library-evolution instead">;
176+
174177
}
175178

176179

lib/Frontend/ArgsToFrontendOptionsConverter.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ bool ArgsToFrontendOptionsConverter::convert(
7373
Opts.EnablePrivateImports |= Args.hasArg(OPT_enable_private_imports);
7474
Opts.EnableLibraryEvolution |= Args.hasArg(OPT_enable_library_evolution);
7575

76+
// FIXME: Remove this flag
77+
Opts.EnableLibraryEvolution |= Args.hasArg(OPT_enable_resilience);
78+
7679
Opts.EnableImplicitDynamic |= Args.hasArg(OPT_enable_implicit_dynamic);
7780

7881
Opts.TrackSystemDeps |= Args.hasArg(OPT_track_system_dependencies);

test/Interpreter/SDK/objc_getClass.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: %target-build-swift-dylib(%t/%target-library-name(resilient_class)) -enable-library-evolution %S/../../Inputs/resilient_class.swift -emit-module -emit-module-path %t/resilient_class.swiftmodule -module-name resilient_class -I%t -L%t -lresilient_struct
77
// RUN: %target-codesign %t/%target-library-name(resilient_class)
88

9-
// RUN: %target-build-swift-dylib(%t/%target-library-name(resilient_objc_class)) -enable-library-evolution %S/../../Inputs/resilient_objc_class.swift -emit-module -emit-module-path %t/resilient_objc_class.swiftmodule -module-name resilient_objc_class -I%t -L%t -lresilient_struct
9+
// RUN: %target-build-swift-dylib(%t/%target-library-name(resilient_objc_class)) -Xfrontend -enable-resilience %S/../../Inputs/resilient_objc_class.swift -emit-module -emit-module-path %t/resilient_objc_class.swiftmodule -module-name resilient_objc_class -I%t -L%t -lresilient_struct
1010
// RUN: %target-codesign %t/%target-library-name(resilient_objc_class)
1111

1212
// RUN: %target-build-swift %s -L %t -I %t -lresilient_struct -lresilient_class -lresilient_objc_class -o %t/main %target-rpath(%t)

test/Serialization/resilience.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212
// RUN: %FileCheck -check-prefix=CHECK -check-prefix=RESILIENCE %s < %t/resilience2.dump.txt
1313
// RUN: %FileCheck -check-prefix=NEGATIVE %s < %t/resilience2.dump.txt
1414

15+
// FIXME: The alternate -enable-resilience flag is going away soon.
16+
17+
// RUN: %target-swift-frontend -emit-module -o %t -enable-resilience %s
18+
// RUN: llvm-bcanalyzer -dump %t/resilience.swiftmodule > %t/resilience2.dump.txt
19+
// RUN: %FileCheck -check-prefix=CHECK -check-prefix=RESILIENCE %s < %t/resilience2.dump.txt
20+
// RUN: %FileCheck -check-prefix=NEGATIVE %s < %t/resilience2.dump.txt
21+
1522
// CHECK: <MODULE_BLOCK {{.*}}>
1623
// RESILIENCE: <RESILIENCE_STRATEGY abbrevid={{[0-9]+}} op0=1/>
1724
// FRAGILE-NOT: <RESILIENCE_STRATEGY abbrevid={{[0-9]+}}

0 commit comments

Comments
 (0)