@@ -1004,6 +1004,7 @@ static bool parseDeclSILOptional(bool *isTransparent,
10041004 IsDynamicallyReplaceable_t *isDynamic,
10051005 IsDistributed_t *isDistributed,
10061006 IsRuntimeAccessible_t *isRuntimeAccessible,
1007+ ForceEnableLexicalLifetimes_t *forceEnableLexicalLifetimes,
10071008 IsExactSelfClass_t *isExactSelfClass,
10081009 SILFunction **dynamicallyReplacedFunction,
10091010 SILFunction **usedAdHocRequirementWitness,
@@ -1042,6 +1043,9 @@ static bool parseDeclSILOptional(bool *isTransparent,
10421043 *isDistributed = IsDistributed;
10431044 else if (isRuntimeAccessible && SP.P .Tok .getText () == " runtime_accessible" )
10441045 *isRuntimeAccessible = IsRuntimeAccessible;
1046+ else if (forceEnableLexicalLifetimes &&
1047+ SP.P .Tok .getText () == " lexical_lifetimes" )
1048+ *forceEnableLexicalLifetimes = DoForceEnableLexicalLifetimes;
10451049 else if (isExactSelfClass && SP.P .Tok .getText () == " exact_self_class" )
10461050 *isExactSelfClass = IsExactSelfClass;
10471051 else if (isCanonical && SP.P .Tok .getText () == " canonical" )
@@ -6793,6 +6797,8 @@ bool SILParserState::parseDeclSIL(Parser &P) {
67936797 IsDynamicallyReplaceable_t isDynamic = IsNotDynamic;
67946798 IsDistributed_t isDistributed = IsNotDistributed;
67956799 IsRuntimeAccessible_t isRuntimeAccessible = IsNotRuntimeAccessible;
6800+ ForceEnableLexicalLifetimes_t forceEnableLexicalLifetimes =
6801+ DoNotForceEnableLexicalLifetimes;
67966802 IsExactSelfClass_t isExactSelfClass = IsNotExactSelfClass;
67976803 bool hasOwnershipSSA = false ;
67986804 IsThunk_t isThunk = IsNotThunk;
@@ -6815,12 +6821,12 @@ bool SILParserState::parseDeclSIL(Parser &P) {
68156821 parseDeclSILOptional (
68166822 &isTransparent, &isSerialized, &isCanonical, &hasOwnershipSSA,
68176823 &isThunk, &isDynamic, &isDistributed, &isRuntimeAccessible,
6818- &isExactSelfClass,
6819- &DynamicallyReplacedFunction, &AdHocWitnessFunction, &objCReplacementFor, &specialPurpose,
6820- &inlineStrategy , &optimizationMode , &perfConstr, nullptr ,
6821- &isWeakImported , &needStackProtection, &availability ,
6822- &isWithoutActuallyEscapingThunk , &Semantics ,
6823- &SpecAttrs, &ClangDecl, &MRK, FunctionState, M) ||
6824+ &forceEnableLexicalLifetimes, & isExactSelfClass,
6825+ &DynamicallyReplacedFunction, &AdHocWitnessFunction,
6826+ &objCReplacementFor , &specialPurpose , &inlineStrategy ,
6827+ &optimizationMode , &perfConstr, nullptr , &isWeakImported ,
6828+ &needStackProtection , &availability, &isWithoutActuallyEscapingThunk ,
6829+ &Semantics, & SpecAttrs, &ClangDecl, &MRK, FunctionState, M) ||
68246830 P.parseToken (tok::at_sign, diag::expected_sil_function_name) ||
68256831 P.parseIdentifier (FnName, FnNameLoc, /* diagnoseDollarPrefix=*/ false ,
68266832 diag::expected_sil_function_name) ||
@@ -6852,6 +6858,8 @@ bool SILParserState::parseDeclSIL(Parser &P) {
68526858 FunctionState.F ->setIsDynamic (isDynamic);
68536859 FunctionState.F ->setIsDistributed (isDistributed);
68546860 FunctionState.F ->setIsRuntimeAccessible (isRuntimeAccessible);
6861+ FunctionState.F ->setForceEnableLexicalLifetimes (
6862+ forceEnableLexicalLifetimes);
68556863 FunctionState.F ->setIsExactSelfClass (isExactSelfClass);
68566864 FunctionState.F ->setDynamicallyReplacedFunction (
68576865 DynamicallyReplacedFunction);
@@ -7058,7 +7066,7 @@ bool SILParserState::parseSILGlobal(Parser &P) {
70587066 if (parseSILLinkage (GlobalLinkage, P) ||
70597067 parseDeclSILOptional (nullptr , &isSerialized, nullptr , nullptr , nullptr ,
70607068 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7061- nullptr , nullptr , nullptr , nullptr , nullptr ,
7069+ nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
70627070 &isLet, nullptr , nullptr , nullptr , nullptr , nullptr ,
70637071 nullptr , nullptr , nullptr , State, M) ||
70647072 P.parseToken (tok::at_sign, diag::expected_sil_value_name) ||
@@ -7111,7 +7119,7 @@ bool SILParserState::parseSILProperty(Parser &P) {
71117119 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
71127120 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
71137121 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7114- nullptr , nullptr , SP, M))
7122+ nullptr , nullptr , nullptr , SP, M))
71157123 return true ;
71167124
71177125 ValueDecl *VD;
@@ -7179,7 +7187,7 @@ bool SILParserState::parseSILVTable(Parser &P) {
71797187 if (parseDeclSILOptional (nullptr , &Serialized, nullptr , nullptr , nullptr ,
71807188 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
71817189 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7182- nullptr , nullptr , nullptr , nullptr , nullptr ,
7190+ nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
71837191 nullptr , nullptr , nullptr , VTableState, M))
71847192 return true ;
71857193
@@ -7290,7 +7298,8 @@ bool SILParserState::parseSILMoveOnlyDeinit(Parser &parser) {
72907298 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
72917299 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
72927300 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7293- nullptr , nullptr , moveOnlyDeinitTableState, M))
7301+ nullptr , nullptr , nullptr , moveOnlyDeinitTableState,
7302+ M))
72947303 return true ;
72957304
72967305 // Parse the class name.
@@ -7775,7 +7784,7 @@ bool SILParserState::parseSILWitnessTable(Parser &P) {
77757784 if (parseDeclSILOptional (nullptr , &isSerialized, nullptr , nullptr , nullptr ,
77767785 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
77777786 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7778- nullptr , nullptr , nullptr , nullptr , nullptr ,
7787+ nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
77797788 nullptr , nullptr , nullptr , WitnessState, M))
77807789 return true ;
77817790
0 commit comments