@@ -53,7 +53,7 @@ class BuilderClosureVisitor
53
53
Expr *buildCallIfWanted (SourceLoc loc,
54
54
Identifier fnName, ArrayRef<Expr *> args,
55
55
ArrayRef<Identifier> argLabels,
56
- bool allowOneWay ) {
56
+ bool oneWay ) {
57
57
if (!wantExpr)
58
58
return nullptr ;
59
59
@@ -87,7 +87,7 @@ class BuilderClosureVisitor
87
87
/* trailing closure*/ nullptr ,
88
88
/* implicit*/ true );
89
89
90
- if (allowOneWay ) {
90
+ if (oneWay ) {
91
91
// Form a one-way constraint to prevent backward propagation.
92
92
result = new (ctx) OneWayExpr (result);
93
93
}
@@ -173,10 +173,10 @@ class BuilderClosureVisitor
173
173
if (builderSupports (ctx.Id_buildExpression )) {
174
174
expr = buildCallIfWanted (expr->getLoc (), ctx.Id_buildExpression ,
175
175
{ expr }, { Identifier () },
176
- /* allowOneWay=*/ true );
177
- } else {
178
- expr = new (ctx) OneWayExpr (expr);
176
+ /* oneWay=*/ false );
179
177
}
178
+
179
+ expr = new (ctx) OneWayExpr (expr);
180
180
}
181
181
182
182
expressions.push_back (expr);
@@ -186,7 +186,7 @@ class BuilderClosureVisitor
186
186
return buildCallIfWanted (braceStmt->getStartLoc (),
187
187
ctx.Id_buildBlock , expressions,
188
188
/* argLabels=*/ { },
189
- /* allowOneWay =*/ true );
189
+ /* oneWay =*/ true );
190
190
}
191
191
192
192
Expr *visitReturnStmt (ReturnStmt *stmt) {
@@ -212,7 +212,7 @@ class BuilderClosureVisitor
212
212
return nullptr ;
213
213
214
214
return buildCallIfWanted (doStmt->getStartLoc (), ctx.Id_buildDo , arg,
215
- /* argLabels=*/ { }, /* allowOneWay =*/ true );
215
+ /* argLabels=*/ { }, /* oneWay =*/ true );
216
216
}
217
217
218
218
CONTROL_FLOW_STMT (Yield)
@@ -299,7 +299,7 @@ class BuilderClosureVisitor
299
299
chainExpr = buildCallIfWanted (ifStmt->getStartLoc (),
300
300
ctx.Id_buildIf , chainExpr,
301
301
/* argLabels=*/ { },
302
- /* allowOneWay =*/ true );
302
+ /* oneWay =*/ true );
303
303
} else {
304
304
// Form a one-way constraint to prevent backward propagation.
305
305
chainExpr = new (ctx) OneWayExpr (chainExpr);
@@ -423,7 +423,7 @@ class BuilderClosureVisitor
423
423
operand = buildCallIfWanted (operand->getStartLoc (),
424
424
ctx.Id_buildEither , operand,
425
425
{isSecond ? ctx.Id_second : ctx.Id_first },
426
- /* allowOneWay =*/ false );
426
+ /* oneWay =*/ false );
427
427
}
428
428
429
429
// Inject into Optional if required. We'll be adding the call to
0 commit comments