Skip to content

Commit b4bd037

Browse files
committed
wip: do not use opaque value expr for sequence
1 parent f259107 commit b4bd037

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

include/swift/AST/Expr.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6724,10 +6724,10 @@ class MacroExpansionExpr final : public Expr,
67246724
}
67256725
};
67266726

6727-
/// OpaqueExpr - created to serve as an indirection to a ForEachStmt's where
6728-
/// clause to avoid visiting it twice in the ASTWalker after having desugared the
6729-
/// loop. This will only be processed in SILGen to emit the underlying
6730-
/// expression.
6727+
/// OpaqueExpr - created to serve as an indirection to a ForEachStmt's sequence
6728+
/// expr and where clause to avoid visiting it twice in the ASTWalker after
6729+
/// having desugared the loop. This will only be processed in SILGen to emit
6730+
/// the underlying expression.
67316731
class OpaqueExpr final : public Expr {
67326732
Expr *OriginalExpr;
67336733

include/swift/AST/Stmt.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,6 @@ class ForEachStmt : public LabeledStmt {
10111011
Expr *nextCall = nullptr;
10121012
BraceStmt *desugaredStmt = nullptr;
10131013
Expr *convertElementExpr = nullptr;
1014-
OpaqueValueExpr *sequenceExpr = nullptr;
10151014

10161015
public:
10171016
ForEachStmt(LabeledStmtInfo LabelInfo, SourceLoc ForLoc, SourceLoc TryLoc,

lib/Sema/TypeCheckStmt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3486,7 +3486,7 @@ static BraceStmt *desugarForEachStmt(ForEachStmt* stmt){
34863486
: ctx.getSequenceMakeIterator();
34873487

34883488
auto *makeIteratorRef = new (ctx) UnresolvedDotExpr(
3489-
opaqueSeqExpr->getOriginalExpr(), SourceLoc(), DeclNameRef(makeIterator->getName()),
3489+
opaqueSeqExpr, SourceLoc(), DeclNameRef(makeIterator->getName()),
34903490
DeclNameLoc(stmt->getForLoc()), /*implicit=*/true);
34913491
makeIteratorRef->setFunctionRefInfo(FunctionRefInfo::singleBaseNameApply());
34923492

0 commit comments

Comments
 (0)