@@ -665,7 +665,8 @@ void SILParser::convertRequirements(ArrayRef<RequirementRepr> From,
665
665
}
666
666
667
667
static bool parseDeclSILOptional (
668
- bool *isTransparent, IsSerialized_t *isSerialized, bool *isCanonical,
668
+ bool *isTransparent, IsSerialized_t *isSerialized,
669
+ IsSerializedForPackage_t *isSerializedForPackage, bool *isCanonical,
669
670
bool *hasOwnershipSSA, bool *hasResultDependsOnSelf, IsThunk_t *isThunk,
670
671
IsDynamicallyReplaceable_t *isDynamic, IsDistributed_t *isDistributed,
671
672
IsRuntimeAccessible_t *isRuntimeAccessible,
@@ -676,10 +677,9 @@ static bool parseDeclSILOptional(
676
677
SILFunction **usedAdHocRequirementWitness, Identifier *objCReplacementFor,
677
678
SILFunction::Purpose *specialPurpose, Inline_t *inlineStrategy,
678
679
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,
683
683
SmallVectorImpl<std::string> *Semantics,
684
684
SmallVectorImpl<ParsedSpecAttr> *SpecAttrs, ValueDecl **ClangDecl,
685
685
EffectsKind *MRK, SILParser &SP, SILModule &M) {
@@ -697,6 +697,9 @@ static bool parseDeclSILOptional(
697
697
*isTransparent = true ;
698
698
else if (isSerialized && SP.P .Tok .getText () == " serialized" )
699
699
*isSerialized = IsSerialized;
700
+ else if (isSerializedForPackage &&
701
+ SP.P .Tok .getText () == " serialized_for_package" )
702
+ *isSerializedForPackage = IsSerializedForPackage;
700
703
else if (isDynamic && SP.P .Tok .getText () == " dynamically_replacable" )
701
704
*isDynamic = IsDynamic;
702
705
else if (isDistributed && SP.P .Tok .getText () == " distributed" )
@@ -7106,6 +7109,7 @@ bool SILParserState::parseDeclSIL(Parser &P) {
7106
7109
7107
7110
bool isTransparent = false ;
7108
7111
IsSerialized_t isSerialized = IsNotSerialized;
7112
+ IsSerializedForPackage_t isSerializedForPackage = IsNotSerializedForPackage;
7109
7113
bool isCanonical = false ;
7110
7114
IsDynamicallyReplaceable_t isDynamic = IsNotDynamic;
7111
7115
IsDistributed_t isDistributed = IsNotDistributed;
@@ -7138,17 +7142,17 @@ bool SILParserState::parseDeclSIL(Parser &P) {
7138
7142
Identifier objCReplacementFor;
7139
7143
if (parseSILLinkage (FnLinkage, P) ||
7140
7144
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,
7144
7148
&useStackForPackMetadata, &hasUnsafeNonEscapableResult,
7145
7149
&isExactSelfClass, &DynamicallyReplacedFunction,
7146
7150
&AdHocWitnessFunction, &objCReplacementFor, &specialPurpose,
7147
7151
&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) ||
7152
7156
P.parseToken (tok::at_sign, diag::expected_sil_function_name) ||
7153
7157
P.parseIdentifier (FnName, FnNameLoc, /* diagnoseDollarPrefix=*/ false ,
7154
7158
diag::expected_sil_function_name) ||
@@ -7173,6 +7177,8 @@ bool SILParserState::parseDeclSIL(Parser &P) {
7173
7177
FunctionState.F ->setBare (IsBare);
7174
7178
FunctionState.F ->setTransparent (IsTransparent_t (isTransparent));
7175
7179
FunctionState.F ->setSerialized (IsSerialized_t (isSerialized));
7180
+ FunctionState.F ->setSerializedForPackage (
7181
+ IsSerializedForPackage_t (isSerializedForPackage));
7176
7182
FunctionState.F ->setWasDeserializedCanonical (isCanonical);
7177
7183
if (!hasOwnershipSSA)
7178
7184
FunctionState.F ->setOwnershipEliminated ();
@@ -7399,10 +7405,9 @@ bool SILParserState::parseSILGlobal(Parser &P) {
7399
7405
parseDeclSILOptional (nullptr , &isSerialized, nullptr , nullptr , nullptr ,
7400
7406
nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7401
7407
nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7402
- nullptr ,
7403
- nullptr , nullptr , nullptr , nullptr , nullptr , &isLet,
7404
7408
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) ||
7406
7411
P.parseToken (tok::at_sign, diag::expected_sil_value_name) ||
7407
7412
P.parseIdentifier (GlobalName, NameLoc, /* diagnoseDollarPrefix=*/ false ,
7408
7413
diag::expected_sil_value_name) ||
@@ -7454,7 +7459,7 @@ bool SILParserState::parseSILProperty(Parser &P) {
7454
7459
nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7455
7460
nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7456
7461
nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7457
- nullptr , nullptr , nullptr , SP, M))
7462
+ nullptr , nullptr , nullptr , nullptr , SP, M))
7458
7463
return true ;
7459
7464
7460
7465
ValueDecl *VD;
@@ -7524,7 +7529,7 @@ bool SILParserState::parseSILVTable(Parser &P) {
7524
7529
nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7525
7530
nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7526
7531
nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7527
- nullptr , nullptr , nullptr , VTableState, M))
7532
+ nullptr , nullptr , nullptr , nullptr , VTableState, M))
7528
7533
return true ;
7529
7534
7530
7535
@@ -7647,7 +7652,8 @@ bool SILParserState::parseSILMoveOnlyDeinit(Parser &parser) {
7647
7652
nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7648
7653
nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7649
7654
nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7650
- nullptr , nullptr , nullptr , moveOnlyDeinitTableState, M))
7655
+ nullptr , nullptr , nullptr , nullptr ,
7656
+ moveOnlyDeinitTableState, M))
7651
7657
return true ;
7652
7658
7653
7659
// Parse the class name.
@@ -8134,7 +8140,7 @@ bool SILParserState::parseSILWitnessTable(Parser &P) {
8134
8140
nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
8135
8141
nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
8136
8142
nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
8137
- nullptr , nullptr , nullptr , WitnessState, M))
8143
+ nullptr , nullptr , nullptr , nullptr , WitnessState, M))
8138
8144
return true ;
8139
8145
8140
8146
// Parse the protocol conformance.
0 commit comments