@@ -919,6 +919,7 @@ static bool parseDeclSILOptional(bool *isTransparent,
919919 bool *isWeakImported,
920920 AvailabilityContext *availability,
921921 bool *isWithoutActuallyEscapingThunk,
922+ bool *isAsync,
922923 SmallVectorImpl<std::string> *Semantics,
923924 SmallVectorImpl<ParsedSpecAttr> *SpecAttrs,
924925 ValueDecl **ClangDecl,
@@ -957,6 +958,8 @@ static bool parseDeclSILOptional(bool *isTransparent,
957958 else if (isWithoutActuallyEscapingThunk
958959 && SP.P .Tok .getText () == " without_actually_escaping" )
959960 *isWithoutActuallyEscapingThunk = true ;
961+ else if (isAsync && SP.P .Tok .getText () == " async" )
962+ *isAsync = true ;
960963 else if (specialPurpose && SP.P .Tok .getText () == " global_init" )
961964 *specialPurpose = SILFunction::Purpose::GlobalInit;
962965 else if (specialPurpose && SP.P .Tok .getText () == " lazy_getter" )
@@ -5681,6 +5684,7 @@ bool SILParserState::parseDeclSIL(Parser &P) {
56815684 bool isWeakImported = false ;
56825685 AvailabilityContext availability = AvailabilityContext::alwaysAvailable ();
56835686 bool isWithoutActuallyEscapingThunk = false ;
5687+ bool isAsync = false ;
56845688 Inline_t inlineStrategy = InlineDefault;
56855689 OptimizationMode optimizationMode = OptimizationMode::NotSet;
56865690 SmallVector<std::string, 1 > Semantics;
@@ -5695,8 +5699,8 @@ bool SILParserState::parseDeclSIL(Parser &P) {
56955699 &isThunk, &isDynamic, &isExactSelfClass, &DynamicallyReplacedFunction,
56965700 &objCReplacementFor, &specialPurpose, &inlineStrategy,
56975701 &optimizationMode, nullptr , &isWeakImported, &availability,
5698- &isWithoutActuallyEscapingThunk, &Semantics,
5699- &SpecAttrs, & ClangDecl, &MRK, FunctionState, M) ||
5702+ &isWithoutActuallyEscapingThunk, &isAsync, & Semantics, &SpecAttrs ,
5703+ &ClangDecl, &MRK, FunctionState, M) ||
57005704 P.parseToken (tok::at_sign, diag::expected_sil_function_name) ||
57015705 P.parseIdentifier (FnName, FnNameLoc, diag::expected_sil_function_name) ||
57025706 P.parseToken (tok::colon, diag::expected_sil_type))
@@ -5734,6 +5738,7 @@ bool SILParserState::parseDeclSIL(Parser &P) {
57345738 FunctionState.F ->setAvailabilityForLinkage (availability);
57355739 FunctionState.F ->setWithoutActuallyEscapingThunk (
57365740 isWithoutActuallyEscapingThunk);
5741+ FunctionState.F ->setAsync (isAsync);
57375742 FunctionState.F ->setInlineStrategy (inlineStrategy);
57385743 FunctionState.F ->setOptimizationMode (optimizationMode);
57395744 FunctionState.F ->setEffectsKind (MRK);
@@ -5919,10 +5924,9 @@ bool SILParserState::parseSILGlobal(Parser &P) {
59195924 SILParser State (P);
59205925 if (parseSILLinkage (GlobalLinkage, P) ||
59215926 parseDeclSILOptional (nullptr , &isSerialized, nullptr , nullptr , nullptr ,
5922- nullptr , nullptr , nullptr , nullptr , nullptr ,
5923- nullptr , nullptr ,
5924- &isLet, nullptr , nullptr , nullptr , nullptr , nullptr ,
5925- nullptr , nullptr , State, M) ||
5927+ nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
5928+ nullptr , &isLet, nullptr , nullptr , nullptr , nullptr ,
5929+ nullptr , nullptr , nullptr , nullptr , State, M) ||
59265930 P.parseToken (tok::at_sign, diag::expected_sil_value_name) ||
59275931 P.parseIdentifier (GlobalName, NameLoc, diag::expected_sil_value_name) ||
59285932 P.parseToken (tok::colon, diag::expected_sil_type))
@@ -5971,7 +5975,7 @@ bool SILParserState::parseSILProperty(Parser &P) {
59715975 if (parseDeclSILOptional (nullptr , &Serialized, nullptr , nullptr , nullptr ,
59725976 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
59735977 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
5974- nullptr , nullptr , nullptr , SP, M))
5978+ nullptr , nullptr , nullptr , nullptr , SP, M))
59755979 return true ;
59765980
59775981 ValueDecl *VD;
@@ -6041,8 +6045,7 @@ bool SILParserState::parseSILVTable(Parser &P) {
60416045 if (parseDeclSILOptional (nullptr , &Serialized, nullptr , nullptr , nullptr ,
60426046 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
60436047 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
6044- nullptr , nullptr , nullptr ,
6045- VTableState, M))
6048+ nullptr , nullptr , nullptr , nullptr , VTableState, M))
60466049 return true ;
60476050
60486051 // Parse the class name.
@@ -6578,8 +6581,7 @@ bool SILParserState::parseSILWitnessTable(Parser &P) {
65786581 if (parseDeclSILOptional (nullptr , &isSerialized, nullptr , nullptr , nullptr ,
65796582 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
65806583 nullptr , nullptr , nullptr , nullptr , nullptr , nullptr ,
6581- nullptr , nullptr , nullptr ,
6582- WitnessState, M))
6584+ nullptr , nullptr , nullptr , nullptr , WitnessState, M))
65836585 return true ;
65846586
65856587 Scope S (&P, ScopeKind::TopLevel);
0 commit comments