@@ -3220,26 +3220,6 @@ void Parser::parseDeclListDelayed(IterableDeclContext *IDC) {
3220
3220
}
3221
3221
}
3222
3222
3223
- // / Return copy of \p existingNodes with \p newNode inserted in source order
3224
- static SmallVector<ASTNode, 8 > insertInOrder (ArrayRef<ASTNode> existingNodes,
3225
- const ASTNode newNode,
3226
- SourceManager &SM) {
3227
- SmallVector<ASTNode, 8 > nodesWithInsertion;
3228
- bool didInsert = false ;
3229
- auto newNodeStart = newNode.getStartLoc ();
3230
- for (auto n : existingNodes) {
3231
- if (SM.isBeforeInBuffer (newNodeStart, n.getStartLoc ())) {
3232
- nodesWithInsertion.push_back (newNode);
3233
- didInsert = true ;
3234
- }
3235
- nodesWithInsertion.push_back (n);
3236
- }
3237
- if (!didInsert)
3238
- nodesWithInsertion.push_back (newNode);
3239
-
3240
- return nodesWithInsertion;
3241
- }
3242
-
3243
3223
void Parser::parseDeclDelayed () {
3244
3224
auto DelayedState = State->takeDelayedDeclState ();
3245
3225
assert (DelayedState.get () && " should have delayed state" );
@@ -3277,15 +3257,6 @@ void Parser::parseDeclDelayed() {
3277
3257
ED->addMember (D);
3278
3258
} else if (auto *SF = dyn_cast<SourceFile>(parent)) {
3279
3259
SF->Decls .push_back (D);
3280
- } else if (auto *CE = dyn_cast<ClosureExpr>(parent)) {
3281
- // Replace the closure body with one including the new Decl, inserted in
3282
- // order.
3283
- auto *const body = CE->getBody ();
3284
- auto Elts = insertInOrder (body->getElements (), D, SourceMgr);
3285
- auto *newBody =
3286
- BraceStmt::create (Context, body->getLBraceLoc (), Elts,
3287
- body->getRBraceLoc (), body->isImplicit ());
3288
- CE->setBody (newBody, false );
3289
3260
}
3290
3261
}
3291
3262
});
0 commit comments