mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[AST] Clean up CaptureListEntry
Don't store a VarDecl separately, expose a `getVar` accessor that forwards onto `getSingleVar`, and rename `Init` to `PBD`.
This commit is contained in:
@@ -1569,7 +1569,7 @@ ManagedValue emitCFunctionPointer(SILGenFunction &SGF,
|
||||
DebugScope scope(SGF, CleanupLocation(captureList));
|
||||
// CaptureListExprs evaluate their bound variables.
|
||||
for (auto capture : captureList->getCaptureList())
|
||||
SGF.visit(capture.Init);
|
||||
SGF.visit(capture.PBD);
|
||||
|
||||
// Emit the closure body.
|
||||
auto *closure = captureList->getClosureBody();
|
||||
@@ -2417,7 +2417,7 @@ RValue RValueEmitter::visitCaptureListExpr(CaptureListExpr *E, SGFContext C) {
|
||||
DebugScope scope(SGF, CleanupLocation(E));
|
||||
// CaptureListExprs evaluate their bound variables.
|
||||
for (auto capture : E->getCaptureList())
|
||||
SGF.visit(capture.Init);
|
||||
SGF.visit(capture.PBD);
|
||||
|
||||
// Then they evaluate to their body.
|
||||
return visit(E->getClosureBody(), C);
|
||||
|
||||
Reference in New Issue
Block a user