@@ -675,6 +675,7 @@ static bool parseDeclSILOptional(
675675 SILFunction **usedAdHocRequirementWitness, Identifier *objCReplacementFor,
676676 SILFunction::Purpose *specialPurpose, Inline_t *inlineStrategy,
677677 OptimizationMode *optimizationMode, PerformanceConstraints *perfConstraints,
678+ bool *isPerformanceConstraint,
678679 bool *markedAsUsed, StringRef *section, bool *isLet, bool *isWeakImported,
679680 bool *needStackProtection, AvailabilityContext *availability,
680681 bool *isWithoutActuallyEscapingThunk,
@@ -774,6 +775,8 @@ static bool parseDeclSILOptional(
774775 *perfConstraints = PerformanceConstraints::NoExistentials;
775776 else if (perfConstraints && SP.P .Tok .getText () == " no_objc_bridging" )
776777 *perfConstraints = PerformanceConstraints::NoObjCBridging;
778+ else if (isPerformanceConstraint && SP.P .Tok .getText () == " perf_constraint" )
779+ *isPerformanceConstraint = true ;
777780 else if (markedAsUsed && SP.P .Tok .getText () == " used" )
778781 *markedAsUsed = true ;
779782 else if (section && SP.P .Tok .getText () == " section" ) {
@@ -7033,6 +7036,7 @@ bool SILParserState::parseDeclSIL(Parser &P) {
70337036 Inline_t inlineStrategy = InlineDefault;
70347037 OptimizationMode optimizationMode = OptimizationMode::NotSet;
70357038 PerformanceConstraints perfConstr = PerformanceConstraints::None;
7039+ bool isPerformanceConstraint = false ;
70367040 bool markedAsUsed = false ;
70377041 StringRef section;
70387042 SmallVector<std::string, 1 > Semantics;
@@ -7050,7 +7054,8 @@ bool SILParserState::parseDeclSIL(Parser &P) {
70507054 &useStackForPackMetadata, &hasUnsafeNonEscapableResult,
70517055 &isExactSelfClass, &DynamicallyReplacedFunction,
70527056 &AdHocWitnessFunction, &objCReplacementFor, &specialPurpose,
7053- &inlineStrategy, &optimizationMode, &perfConstr, &markedAsUsed,
7057+ &inlineStrategy, &optimizationMode, &perfConstr,
7058+ &isPerformanceConstraint, &markedAsUsed,
70547059 §ion, nullptr , &isWeakImported, &needStackProtection,
70557060 &availability, &isWithoutActuallyEscapingThunk, &Semantics,
70567061 &SpecAttrs, &ClangDecl, &MRK, FunctionState, M) ||
@@ -7106,6 +7111,7 @@ bool SILParserState::parseDeclSIL(Parser &P) {
71067111 FunctionState.F ->setInlineStrategy (inlineStrategy);
71077112 FunctionState.F ->setOptimizationMode (optimizationMode);
71087113 FunctionState.F ->setPerfConstraints (perfConstr);
7114+ FunctionState.F ->setIsPerformanceConstraint (isPerformanceConstraint);
71097115 FunctionState.F ->setEffectsKind (MRK);
71107116
71117117 if (ClangDecl)
@@ -7302,6 +7308,7 @@ bool SILParserState::parseSILGlobal(Parser &P) {
73027308 parseDeclSILOptional (nullptr , &isSerialized, nullptr , nullptr , nullptr ,
73037309 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
73047310 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7311+ nullptr ,
73057312 nullptr , nullptr , nullptr , nullptr , nullptr , &isLet,
73067313 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
73077314 nullptr , nullptr , State, M) ||
@@ -7356,7 +7363,7 @@ bool SILParserState::parseSILProperty(Parser &P) {
73567363 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
73577364 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
73587365 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7359- nullptr , nullptr , SP, M))
7366+ nullptr , nullptr , nullptr , SP, M))
73607367 return true ;
73617368
73627369 ValueDecl *VD;
@@ -7426,7 +7433,7 @@ bool SILParserState::parseSILVTable(Parser &P) {
74267433 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
74277434 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
74287435 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7429- nullptr , nullptr , VTableState, M))
7436+ nullptr , nullptr , nullptr , VTableState, M))
74307437 return true ;
74317438
74327439 // Parse the class name.
@@ -7537,7 +7544,7 @@ bool SILParserState::parseSILMoveOnlyDeinit(Parser &parser) {
75377544 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
75387545 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
75397546 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
7540- nullptr , nullptr , moveOnlyDeinitTableState, M))
7547+ nullptr , nullptr , nullptr , moveOnlyDeinitTableState, M))
75417548 return true ;
75427549
75437550 // Parse the class name.
@@ -8024,7 +8031,7 @@ bool SILParserState::parseSILWitnessTable(Parser &P) {
80248031 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
80258032 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
80268033 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
8027- nullptr , nullptr , WitnessState, M))
8034+ nullptr , nullptr , nullptr , WitnessState, M))
80288035 return true ;
80298036
80308037 // Parse the protocol conformance.
0 commit comments