Skip to content

Commit ae84ac8

Browse files
committed
Add a frontend option to enable parsing "operator protocol designators".
1 parent 78560c7 commit ae84ac8

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ namespace swift {
203203
/// \brief Enable experimental property behavior feature.
204204
bool EnableExperimentalPropertyBehaviors = false;
205205

206+
/// \brief Enable experimental operator protocol designator feature.
207+
bool EnableOperatorDesignatedProtocols = false;
208+
206209
/// \brief Staging flag for treating inout parameters as Thread Sanitizer
207210
/// accesses.
208211
bool DisableTsanInoutInstrumentation = false;

include/swift/Option/FrontendOptions.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ def enable_experimental_property_behaviors :
309309
Flag<["-"], "enable-experimental-property-behaviors">,
310310
HelpText<"Enable experimental property behaviors">;
311311

312+
def enable_operator_designated_protocols :
313+
Flag<["-"], "enable-operator-designated-protocols">,
314+
HelpText<"Enable operator designated protocols">;
315+
312316
def enable_deserialization_recovery :
313317
Flag<["-"], "enable-deserialization-recovery">,
314318
HelpText<"Attempt to recover from missing xrefs (etc) in swiftmodules">;

lib/Frontend/CompilerInvocation.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
161161
Opts.EnableExperimentalPropertyBehaviors |=
162162
Args.hasArg(OPT_enable_experimental_property_behaviors);
163163

164+
Opts.EnableOperatorDesignatedProtocols |=
165+
Args.hasArg(OPT_enable_operator_designated_protocols);
166+
164167
if (auto A = Args.getLastArg(OPT_enable_deserialization_recovery,
165168
OPT_disable_deserialization_recovery)) {
166169
Opts.EnableDeserializationRecovery

0 commit comments

Comments
 (0)