Skip to content

Commit d2b5de9

Browse files
committed
---
yaml --- r: 341756 b: refs/heads/rxwei-patch-1 c: 4820d16 h: refs/heads/master
1 parent cb57bdf commit d2b5de9

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-08-18-a: b10b1fce14385faa6d44f6b933e95
10151015
refs/heads/rdar-43033749-fix-batch-mode-no-diags-swift-5.0-branch: a14e64eaad30de89f0f5f0b2a782eed7ecdcb255
10161016
refs/heads/revert-19006-error-bridging-integer-type: 8a9065a3696535305ea53fe9b71f91cbe6702019
10171017
refs/heads/revert-19050-revert-19006-error-bridging-integer-type: ecf752d54b05dd0a20f510f0bfa54a3fec3bcaca
1018-
refs/heads/rxwei-patch-1: c13872248da2ae995f9e868cb18273f7dd05040f
1018+
refs/heads/rxwei-patch-1: 4820d16d7fd6c661035c5a26ab241d5b44d8337b
10191019
refs/heads/shahmishal-patch-1: e58ec0f7488258d42bef51bc3e6d7b3dc74d7b2a
10201020
refs/heads/typelist-existential: 4046359efd541fb5c72d69a92eefc0a784df8f5e
10211021
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-20-a: 4319ba09e4fb8650ee86061075c74a016b6baab9

branches/rxwei-patch-1/include/swift/AST/Decl.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5773,6 +5773,11 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
57735773
setBodyKind(BodyKind::Unparsed);
57745774
}
57755775

5776+
/// Provide the parsed body for the function.
5777+
void setBodyParsed(BraceStmt *S) {
5778+
setBody(S, BodyKind::Parsed);
5779+
}
5780+
57765781
/// Note that parsing for the body was delayed.
57775782
///
57785783
/// The function should return the body statement and a flag indicating

branches/rxwei-patch-1/lib/Parse/ParseDecl.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4636,9 +4636,9 @@ ParserStatus Parser::parseGetSet(ParseDeclOptions Flags,
46364636
Indices, ElementTy, StaticLoc, Flags, AccessorKind::Get,
46374637
storage, this, /*AccessorKeywordLoc*/ SourceLoc());
46384638
CCE = new (Context) CodeCompletionExpr(Tok.getLoc());
4639-
getter->setBody(BraceStmt::create(Context, Tok.getLoc(),
4640-
ASTNode(CCE), Tok.getLoc(),
4641-
/*implicit*/ true));
4639+
getter->setBodyParsed(BraceStmt::create(Context, Tok.getLoc(),
4640+
ASTNode(CCE), Tok.getLoc(),
4641+
/*implicit*/ true));
46424642
accessors.add(getter);
46434643
CodeCompletion->setParsedDecl(getter);
46444644
} else {
@@ -5763,7 +5763,7 @@ void Parser::parseAbstractFunctionBody(AbstractFunctionDecl *AFD) {
57635763
ParserResult<BraceStmt> Body = parseBraceItemList(diag::invalid_diagnostic);
57645764
if (!Body.isNull()) {
57655765
BraceStmt * BS = Body.get();
5766-
AFD->setBody(BS);
5766+
AFD->setBodyParsed(BS);
57675767

57685768
// If the body consists of a single expression, turn it into a return
57695769
// statement.
@@ -5853,7 +5853,7 @@ bool Parser::parseAbstractFunctionBodyDelayed(AbstractFunctionDecl *AFD) {
58535853
// FIXME: Should do some sort of error recovery here?
58545854
return true;
58555855
} else {
5856-
AFD->setBody(Body.get());
5856+
AFD->setBodyParsed(Body.get());
58575857
}
58585858

58595859
return false;

branches/rxwei-patch-1/lib/Parse/ParseStmt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ ParserResult<Stmt> Parser::parseStmtDefer() {
988988
if (Body.isNull())
989989
return nullptr;
990990
Status |= Body;
991-
tempDecl->setBody(Body.get());
991+
tempDecl->setBodyParsed(Body.get());
992992
}
993993

994994
SourceLoc loc = tempDecl->getBodySourceRange().Start;

0 commit comments

Comments
 (0)