Skip to content

Commit de13835

Browse files
committed
[SILGen] Improve documentation of SE-0408, put back the documentation that was misplaced.
1 parent cfcad2b commit de13835

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/SILGen/SILGenStmt.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,8 +1246,6 @@ void StmtEmitter::visitRepeatWhileStmt(RepeatWhileStmt *S) {
12461246
}
12471247

12481248
void StmtEmitter::visitForEachStmt(ForEachStmt *S) {
1249-
// Emit the 'iterator' variable that we'll be using for iteration.
1250-
LexicalScope OuterForScope(SGF, CleanupLocation(S));
12511249

12521250
if (auto *expansion =
12531251
dyn_cast<PackExpansionExpr>(S->getTypeCheckedSequence())) {
@@ -1257,7 +1255,6 @@ void StmtEmitter::visitForEachStmt(ForEachStmt *S) {
12571255

12581256
JumpDest loopDest = createJumpDest(S->getBody());
12591257

1260-
// Set the destinations for 'break' and 'continue'.
12611258
JumpDest endDest = createJumpDest(S->getBody());
12621259

12631260
SGF.emitDynamicPackLoop(
@@ -1271,6 +1268,7 @@ void StmtEmitter::visitForEachStmt(ForEachStmt *S) {
12711268

12721269
SGF.emitExprInto(expansion->getPatternExpr(), letValueInit.get());
12731270

1271+
// Set the destinations for 'break' and 'continue'.
12741272
SGF.BreakContinueDestStack.push_back({S, endDest, loopDest});
12751273
visit(S->getBody());
12761274
SGF.BreakContinueDestStack.pop_back();
@@ -1284,6 +1282,8 @@ void StmtEmitter::visitForEachStmt(ForEachStmt *S) {
12841282
return;
12851283
}
12861284

1285+
// Emit the 'iterator' variable that we'll be using for iteration.
1286+
LexicalScope OuterForScope(SGF, CleanupLocation(S));
12871287
SGF.emitPatternBinding(S->getIteratorVar(),
12881288
/*index=*/0, /*debuginfo*/ true);
12891289

0 commit comments

Comments
 (0)