File tree Expand file tree Collapse file tree 3 files changed +0
-34
lines changed Expand file tree Collapse file tree 3 files changed +0
-34
lines changed Original file line number Diff line number Diff line change @@ -89,20 +89,6 @@ class AnyFunctionRef {
89
89
return TheFunction.get <AbstractClosureExpr *>()->getSingleExpressionBody ();
90
90
}
91
91
92
- void setSingleExpressionBody (Expr *expr) {
93
- if (auto *AFD = TheFunction.dyn_cast <AbstractFunctionDecl *>()) {
94
- AFD->setSingleExpressionBody (expr);
95
- return ;
96
- }
97
-
98
- auto ACE = TheFunction.get <AbstractClosureExpr *>();
99
- if (auto CE = dyn_cast<ClosureExpr>(ACE)) {
100
- CE->setSingleExpressionBody (expr);
101
- } else {
102
- cast<AutoClosureExpr>(ACE)->setBody (expr);
103
- }
104
- }
105
-
106
92
Type getType () const {
107
93
if (auto *AFD = TheFunction.dyn_cast <AbstractFunctionDecl *>())
108
94
return AFD->getInterfaceType ();
Original file line number Diff line number Diff line change @@ -3891,13 +3891,6 @@ class ClosureExpr : public AbstractClosureExpr {
3891
3891
// / Only valid when \c hasSingleExpressionBody() is true.
3892
3892
Expr *getSingleExpressionBody () const ;
3893
3893
3894
- // / Set the body for a closure that has a single expression as its
3895
- // / body.
3896
- // /
3897
- // / This routine cannot change whether a closure has a single expression as
3898
- // / its body; it can only update that expression.
3899
- void setSingleExpressionBody (Expr *NewBody);
3900
-
3901
3894
// / Is this a completely empty closure?
3902
3895
bool hasEmptyBody () const ;
3903
3896
Original file line number Diff line number Diff line change @@ -1898,19 +1898,6 @@ Expr *ClosureExpr::getSingleExpressionBody() const {
1898
1898
return body.get <Expr *>();
1899
1899
}
1900
1900
1901
- void ClosureExpr::setSingleExpressionBody (Expr *NewBody) {
1902
- assert (hasSingleExpressionBody () && " Not a single-expression body" );
1903
- auto body = getBody ()->getFirstElement ();
1904
- if (auto stmt = body.dyn_cast <Stmt *>()) {
1905
- if (auto braceStmt = dyn_cast<BraceStmt>(stmt))
1906
- braceStmt->getFirstElement () = NewBody;
1907
- else
1908
- cast<ReturnStmt>(stmt)->setResult (NewBody);
1909
- return ;
1910
- }
1911
- getBody ()->setFirstElement (NewBody);
1912
- }
1913
-
1914
1901
bool ClosureExpr::hasEmptyBody () const {
1915
1902
return getBody ()->empty ();
1916
1903
}
You can’t perform that action at this time.
0 commit comments