@@ -3917,31 +3917,6 @@ static unsigned skipBracedBlock(Parser &P,
3917
3917
return OpenBraces;
3918
3918
}
3919
3919
3920
- void Parser::consumeGetSetBody (AbstractFunctionDecl *AFD,
3921
- SourceLoc LBLoc) {
3922
- SourceLoc SavedPreviousLoc = PreviousLoc;
3923
-
3924
- SourceRange BodyRange;
3925
- BodyRange.Start = Tok.getLoc ();
3926
-
3927
- // Skip until the next '}' at the correct nesting level.
3928
- unsigned OpenBraces = skipUntilMatchingRBrace (*this , SyntaxContext);
3929
-
3930
- if (OpenBraces != 1 ) {
3931
- // FIXME: implement some error recovery?
3932
- }
3933
-
3934
- BodyRange.End = PreviousLoc;
3935
-
3936
- if (DelayedParseCB->shouldDelayFunctionBodyParsing (
3937
- *this , AFD, AFD->getAttrs (), BodyRange)) {
3938
- State->delayAccessorBodyParsing (AFD, BodyRange, SavedPreviousLoc, LBLoc);
3939
- AFD->setBodyDelayed (BodyRange);
3940
- } else {
3941
- AFD->setBodySkipped (BodyRange);
3942
- }
3943
- }
3944
-
3945
3920
// / Returns a descriptive name for the given accessor/addressor kind.
3946
3921
static StringRef getAccessorNameForDiagnostic (AccessorKind accessorKind,
3947
3922
AddressorKind addressorKind,
@@ -4262,46 +4237,6 @@ bool Parser::parseGetSet(ParseDeclOptions Flags,
4262
4237
return Invalid;
4263
4238
}
4264
4239
4265
- void Parser::parseAccessorBodyDelayed (AbstractFunctionDecl *AFD) {
4266
- assert (!AFD->getBody () && " function should not have a parsed body" );
4267
- assert (AFD->getBodyKind () == AbstractFunctionDecl::BodyKind::Unparsed &&
4268
- " function body should be delayed" );
4269
-
4270
- auto AccessorParserState = State->takeAccessorBodyState (AFD);
4271
- assert (AccessorParserState.get () && " should have a valid state" );
4272
-
4273
- auto BeginParserPosition = getParserPosition (AccessorParserState->BodyPos );
4274
- auto EndLexerState = L->getStateForEndOfTokenLoc (AFD->getEndLoc ());
4275
-
4276
- // ParserPositionRAII needs a primed parser to restore to.
4277
- if (Tok.is (tok::NUM_TOKENS))
4278
- consumeTokenWithoutFeedingReceiver ();
4279
-
4280
- // Ensure that we restore the parser state at exit.
4281
- ParserPositionRAII PPR (*this );
4282
-
4283
- // Create a lexer that cannot go past the end state.
4284
- Lexer LocalLex (*L, BeginParserPosition.LS , EndLexerState);
4285
-
4286
- // Temporarily swap out the parser's current lexer with our new one.
4287
- llvm::SaveAndRestore<Lexer *> T (L, &LocalLex);
4288
-
4289
- // Rewind to the first token of the accessor body.
4290
- restoreParserPosition (BeginParserPosition);
4291
-
4292
- // Re-enter the lexical scope.
4293
- Scope S (this , AccessorParserState->takeScope ());
4294
- ParseFunctionBody CC (*this , AFD);
4295
- setLocalDiscriminatorToParamList (AFD->getParameters ());
4296
-
4297
- SmallVector<ASTNode, 16 > Entries;
4298
- parseBraceItems (Entries);
4299
- BraceStmt *Body =
4300
- BraceStmt::create (Context, AccessorParserState->LBLoc , Entries,
4301
- Tok.getLoc ());
4302
- AFD->setBody (Body);
4303
- }
4304
-
4305
4240
static void fillInAccessorTypeErrors (Parser &P, FuncDecl *accessor,
4306
4241
AccessorKind kind) {
4307
4242
if (!accessor) return ;
0 commit comments