@@ -425,18 +425,6 @@ std::pair<bool, Expr *> ModelASTWalker::walkToExprPre(Expr *E) {
425
425
if (isVisitedBeforeInIfConfig (E))
426
426
return {false , E};
427
427
428
- // In SequenceExpr, explicit cast expressions (e.g. 'as', 'is') appear twice.
429
- // Skip pointers we've already seen.
430
- if (auto SE = dyn_cast<SequenceExpr>(E)) {
431
- SmallPtrSet<Expr *, 5 > seenExpr;
432
- for (auto subExpr : SE->getElements ()) {
433
- if (!seenExpr.insert (subExpr).second )
434
- continue ;
435
- subExpr->walk (*this );
436
- }
437
- return { false , SE };
438
- }
439
-
440
428
auto addCallArgExpr = [&](Expr *Elem, TupleExpr *ParentTupleExpr) {
441
429
if (isCurrentCallArgExpr (ParentTupleExpr)) {
442
430
CharSourceRange NR = parameterNameRangeOfCallArg (ParentTupleExpr, Elem);
@@ -558,6 +546,18 @@ std::pair<bool, Expr *> ModelASTWalker::walkToExprPre(Expr *E) {
558
546
Closure->getExplicitResultTypeLoc ().getSourceRange ());
559
547
560
548
pushStructureNode (SN, Closure);
549
+ } else if (auto SE = dyn_cast<SequenceExpr>(E)) {
550
+ // In SequenceExpr, explicit cast expressions (e.g. 'as', 'is') appear
551
+ // twice. Skip pointers we've already seen.
552
+ SmallPtrSet<Expr *, 5 > seenExpr;
553
+ for (auto subExpr : SE->getElements ()) {
554
+ if (!seenExpr.insert (subExpr).second ) {
555
+ continue ;
556
+ }
557
+ llvm::SaveAndRestore<ASTWalker::ParentTy> SetParent (Parent, E);
558
+ subExpr->walk (*this );
559
+ }
560
+ return { false , walkToExprPost (SE) };
561
561
}
562
562
563
563
return { true , E };
0 commit comments