@@ -665,7 +665,8 @@ void SILParser::convertRequirements(ArrayRef<RequirementRepr> From,
665665}
666666
667667static bool parseDeclSILOptional (
668- bool *isTransparent, IsSerialized_t *isSerialized, bool *isCanonical,
668+ bool *isTransparent, IsSerialized_t *isSerialized,
669+ IsSerializedForPackage_t *isSerializedForPackage, bool *isCanonical,
669670 bool *hasOwnershipSSA, bool *hasResultDependsOnSelf, IsThunk_t *isThunk,
670671 IsDynamicallyReplaceable_t *isDynamic, IsDistributed_t *isDistributed,
671672 IsRuntimeAccessible_t *isRuntimeAccessible,
@@ -676,10 +677,9 @@ static bool parseDeclSILOptional(
676677 SILFunction **usedAdHocRequirementWitness, Identifier *objCReplacementFor,
677678 SILFunction::Purpose *specialPurpose, Inline_t *inlineStrategy,
678679 OptimizationMode *optimizationMode, PerformanceConstraints *perfConstraints,
679- bool *isPerformanceConstraint,
680- bool *markedAsUsed, StringRef *section, bool *isLet, bool *isWeakImported,
681- bool *needStackProtection, AvailabilityContext *availability,
682- bool *isWithoutActuallyEscapingThunk,
680+ bool *isPerformanceConstraint, bool *markedAsUsed, StringRef *section,
681+ bool *isLet, bool *isWeakImported, bool *needStackProtection,
682+ AvailabilityContext *availability, bool *isWithoutActuallyEscapingThunk,
683683 SmallVectorImpl<std::string> *Semantics,
684684 SmallVectorImpl<ParsedSpecAttr> *SpecAttrs, ValueDecl **ClangDecl,
685685 EffectsKind *MRK, SILParser &SP, SILModule &M) {
@@ -697,6 +697,9 @@ static bool parseDeclSILOptional(
697697 *isTransparent = true ;
698698 else if (isSerialized && SP.P .Tok .getText () == " serialized" )
699699 *isSerialized = IsSerialized;
700+ else if (isSerializedForPackage &&
701+ SP.P .Tok .getText () == " serialized_for_package" )
702+ *isSerializedForPackage = IsSerializedForPackage;
700703 else if (isDynamic && SP.P .Tok .getText () == " dynamically_replacable" )
701704 *isDynamic = IsDynamic;
702705 else if (isDistributed && SP.P .Tok .getText () == " distributed" )
@@ -7106,6 +7109,7 @@ bool SILParserState::parseDeclSIL(Parser &P) {
71067109
71077110 bool isTransparent = false ;
71087111 IsSerialized_t isSerialized = IsNotSerialized;
7112+ IsSerializedForPackage_t isSerializedForPackage = IsNotSerializedForPackage;
71097113 bool isCanonical = false ;
71107114 IsDynamicallyReplaceable_t isDynamic = IsNotDynamic;
71117115 IsDistributed_t isDistributed = IsNotDistributed;
@@ -7138,17 +7142,17 @@ bool SILParserState::parseDeclSIL(Parser &P) {
71387142 Identifier objCReplacementFor;
71397143 if (parseSILLinkage (FnLinkage, P) ||
71407144 parseDeclSILOptional (
7141- &isTransparent, &isSerialized, &isCanonical , &hasOwnershipSSA ,
7142- &hasResultDependsOnSelf , &isThunk , &isDynamic , &isDistributed ,
7143- &isRuntimeAccessible, &forceEnableLexicalLifetimes,
7145+ &isTransparent, &isSerialized, &isSerializedForPackage , &isCanonical ,
7146+ &hasOwnershipSSA , &hasResultDependsOnSelf , &isThunk , &isDynamic ,
7147+ &isDistributed, & isRuntimeAccessible, &forceEnableLexicalLifetimes,
71447148 &useStackForPackMetadata, &hasUnsafeNonEscapableResult,
71457149 &isExactSelfClass, &DynamicallyReplacedFunction,
71467150 &AdHocWitnessFunction, &objCReplacementFor, &specialPurpose,
71477151 &inlineStrategy, &optimizationMode, &perfConstr,
7148- &isPerformanceConstraint, &markedAsUsed,
7149- §ion, nullptr , &isWeakImported , &needStackProtection ,
7150- &availability , &isWithoutActuallyEscapingThunk , &Semantics ,
7151- &SpecAttrs, &ClangDecl, & MRK, FunctionState, M) ||
7152+ &isPerformanceConstraint, &markedAsUsed, §ion, nullptr ,
7153+ &isWeakImported, &needStackProtection , &availability ,
7154+ &isWithoutActuallyEscapingThunk , &Semantics , &SpecAttrs, &ClangDecl ,
7155+ &MRK, FunctionState, M) ||
71527156 P.parseToken (tok::at_sign, diag::expected_sil_function_name) ||
71537157 P.parseIdentifier (FnName, FnNameLoc, /* diagnoseDollarPrefix=*/ false ,
71547158 diag::expected_sil_function_name) ||
@@ -7173,6 +7177,8 @@ bool SILParserState::parseDeclSIL(Parser &P) {
71737177 FunctionState.F ->setBare (IsBare);
71747178 FunctionState.F ->setTransparent (IsTransparent_t (isTransparent));
71757179 FunctionState.F ->setSerialized (IsSerialized_t (isSerialized));
7180+ FunctionState.F ->setSerializedForPackage (
7181+ IsSerializedForPackage_t (isSerializedForPackage));
71767182 FunctionState.F ->setWasDeserializedCanonical (isCanonical);
71777183 if (!hasOwnershipSSA)
71787184 FunctionState.F ->setOwnershipEliminated ();
@@ -7399,10 +7405,9 @@ bool SILParserState::parseSILGlobal(Parser &P) {
73997405 parseDeclSILOptional (nullptr , &isSerialized, nullptr , nullptr , nullptr ,
74007406 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
74017407 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7402- nullptr ,
7403- nullptr , nullptr , nullptr , nullptr , nullptr , &isLet,
74047408 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7405- nullptr , nullptr , State, M) ||
7409+ nullptr , &isLet, nullptr , nullptr , nullptr , nullptr ,
7410+ nullptr , nullptr , nullptr , nullptr , State, M) ||
74067411 P.parseToken (tok::at_sign, diag::expected_sil_value_name) ||
74077412 P.parseIdentifier (GlobalName, NameLoc, /* diagnoseDollarPrefix=*/ false ,
74087413 diag::expected_sil_value_name) ||
@@ -7455,7 +7460,7 @@ bool SILParserState::parseSILProperty(Parser &P) {
74557460 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
74567461 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
74577462 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7458- nullptr , nullptr , nullptr , SP, M))
7463+ nullptr , nullptr , nullptr , nullptr , SP, M))
74597464 return true ;
74607465
74617466 ValueDecl *VD;
@@ -7525,7 +7530,7 @@ bool SILParserState::parseSILVTable(Parser &P) {
75257530 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
75267531 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
75277532 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7528- nullptr , nullptr , nullptr , VTableState, M))
7533+ nullptr , nullptr , nullptr , nullptr , VTableState, M))
75297534 return true ;
75307535
75317536
@@ -7648,7 +7653,8 @@ bool SILParserState::parseSILMoveOnlyDeinit(Parser &parser) {
76487653 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
76497654 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
76507655 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7651- nullptr , nullptr , nullptr , moveOnlyDeinitTableState, M))
7656+ nullptr , nullptr , nullptr , nullptr ,
7657+ moveOnlyDeinitTableState, M))
76527658 return true ;
76537659
76547660 // Parse the class name.
@@ -8135,7 +8141,7 @@ bool SILParserState::parseSILWitnessTable(Parser &P) {
81358141 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
81368142 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
81378143 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
8138- nullptr , nullptr , nullptr , WitnessState, M))
8144+ nullptr , nullptr , nullptr , nullptr , WitnessState, M))
81398145 return true ;
81408146
81418147 // Parse the protocol conformance.
0 commit comments