@@ -368,13 +368,15 @@ class ExprVisitor : public AstVisitorBase<ExprVisitor> {
368
368
assert (expr->getBody () && " ClosureExpr has getBody()" );
369
369
auto bodyLabel = dispatcher_.fetchLabel (expr->getBody ());
370
370
dispatcher_.emit (ClosureExprsTrap{label, bodyLabel});
371
+ emitAbstractClosureExpr (expr, label);
371
372
}
372
373
373
374
void visitAutoClosureExpr (swift::AutoClosureExpr* expr) {
374
375
auto label = dispatcher_.assignNewLabel (expr);
375
376
assert (expr->getBody () && " AutoClosureExpr has getBody()" );
376
377
auto bodyLabel = dispatcher_.fetchLabel (expr->getBody ());
377
378
dispatcher_.emit (AutoClosureExprsTrap{label, bodyLabel});
379
+ emitAbstractClosureExpr (expr, label);
378
380
}
379
381
380
382
void visitCoerceExpr (swift::CoerceExpr* expr) {
@@ -534,6 +536,16 @@ class ExprVisitor : public AstVisitorBase<ExprVisitor> {
534
536
}
535
537
536
538
private:
539
+ void emitAbstractClosureExpr (swift::AbstractClosureExpr* expr,
540
+ TrapLabel<AbstractClosureExprTag> label) {
541
+ assert (expr->getParameters () && " AbstractClosureExpr has getParameters()" );
542
+ auto params = expr->getParameters ();
543
+ for (auto i = 0u ; i < params->size (); ++i) {
544
+ dispatcher_.emit (
545
+ AbstractClosureExprParamsTrap{label, i, dispatcher_.fetchLabel (params->get (i))});
546
+ }
547
+ }
548
+
537
549
TrapLabel<ArgumentTag> emitArgument (const swift::Argument& arg) {
538
550
auto argLabel = dispatcher_.createLabel <ArgumentTag>();
539
551
assert (arg.getExpr () && " Argument has getExpr" );
0 commit comments