Skip to content
This repository was archived by the owner on Apr 2, 2020. It is now read-only.

Commit 8b50e7e

Browse files
authored
Merge pull request #1757 from slavapestov/set-capture-info-change
[Swift] AbstractFunctionDecl::getCaptureInfo() no longer returns a mutable reference
2 parents 095f7ed + ad740c6 commit 8b50e7e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

source/Plugins/ExpressionParser/Swift/SwiftASTManipulator.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,14 +1277,15 @@ bool SwiftASTManipulator::AddExternalVariables(
12771277
static void AppendToCaptures(swift::ASTContext &ast_context,
12781278
swift::FuncDecl *func_decl,
12791279
swift::VarDecl *capture_decl) {
1280-
llvm::ArrayRef<swift::CapturedValue> old_captures =
1281-
func_decl->getCaptureInfo().getCaptures();
1280+
auto capture_info = func_decl->getCaptureInfo();
1281+
auto old_captures = capture_info.getCaptures();
12821282
llvm::SmallVector<swift::CapturedValue, 2> captures(old_captures.begin(),
12831283
old_captures.end());
12841284

12851285
captures.push_back(swift::CapturedValue(capture_decl, 0, swift::SourceLoc()));
1286+
capture_info.setCaptures(ast_context.AllocateCopy(captures));
12861287

1287-
func_decl->getCaptureInfo().setCaptures(ast_context.AllocateCopy(captures));
1288+
func_decl->setCaptureInfo(capture_info);
12881289
}
12891290

12901291
static swift::VarDecl *FindArgInFunction(swift::ASTContext &ast_context,

0 commit comments

Comments
 (0)