Skip to content

Commit c735272

Browse files
committed
Frontend: Introduce stub mode for -unavailable-decl-optimization.
Part of rdar://107388493
1 parent 396f1dc commit c735272

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ namespace swift {
112112
/// resulting binary by default in this mode.
113113
None,
114114

115+
/// Stub out code associated with unavailable declarations.
116+
///
117+
/// For example, the bodies of unavailable functions should be compiled as
118+
/// if they just contained a call to fatalError().
119+
Stub,
120+
115121
/// Avoid generating any code for unavailable declarations.
116122
///
117123
/// NOTE: This optimization can be ABI breaking for a library evolution

lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
614614
auto value =
615615
llvm::StringSwitch<Optional<UnavailableDeclOptimization>>(A->getValue())
616616
.Case("none", UnavailableDeclOptimization::None)
617+
.Case("stub", UnavailableDeclOptimization::Stub)
617618
.Case("complete", UnavailableDeclOptimization::Complete)
618619
.Default(None);
619620

0 commit comments

Comments
 (0)