Skip to content

Commit 583c0d9

Browse files
committed
Frontend: Add -enable-resilient-objc-class-stubs command line flag
1 parent 9ceb3fa commit 583c0d9

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,11 @@ namespace swift {
296296
/// set to true.
297297
bool ExperimentalDependenciesIncludeIntrafileOnes = false;
298298

299+
/// Enable experimental support for emitting Objective-C resilient class
300+
/// stubs. This is a language option since it also determines if we admit
301+
/// @objc members in extensions of classes with resilient ancestry.
302+
bool EnableObjCResilientClassStubs = false;
303+
299304
/// Sets the target we are building for and updates platform conditions
300305
/// to match.
301306
///

include/swift/Option/FrontendOptions.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,4 +555,8 @@ def type_info_dump_filter_EQ : Joined<["-"], "type-info-dump-filter=">,
555555
Flags<[FrontendOption]>,
556556
HelpText<"One of 'all', 'resilient' or 'fragile'">;
557557

558+
def enable_objc_resilient_class_stubs : Flag<["-"], "enable-resilient-objc-class-stubs">,
559+
HelpText<"Emit Objective-C resilient class stubs for classes with "
560+
"resiliently-sized metadata">;
561+
558562
} // end let Flags = [FrontendOption, NoDriverOption, HelpHidden]

lib/Frontend/CompilerInvocation.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
450450
Opts.DisableConstraintSolverPerformanceHacks |=
451451
Args.hasArg(OPT_disable_constraint_solver_performance_hacks);
452452

453+
Opts.EnableObjCResilientClassStubs =
454+
Args.hasArg(OPT_enable_objc_resilient_class_stubs);
455+
453456
// Must be processed after any other language options that could affect
454457
// platform conditions.
455458
bool UnsupportedOS, UnsupportedArch;

0 commit comments

Comments
 (0)