@@ -123,8 +123,6 @@ struct MapRegionCounters : public ASTWalker {
123
123
CounterMap[WS->getBody ()] = NextCounter++;
124
124
} else if (auto *RWS = dyn_cast<RepeatWhileStmt>(S)) {
125
125
CounterMap[RWS->getBody ()] = NextCounter++;
126
- } else if (auto *FS = dyn_cast<ForStmt>(S)) {
127
- CounterMap[FS->getBody ()] = NextCounter++;
128
126
} else if (auto *FES = dyn_cast<ForEachStmt>(S)) {
129
127
CounterMap[FES->getBody ()] = NextCounter++;
130
128
walkPatternForProfiling (FES->getIterator (), *this );
@@ -536,14 +534,6 @@ struct CoverageMapping : public ASTWalker {
536
534
assignCounter (RWS->getCond (), CounterExpr::Ref (BodyCounter));
537
535
RepeatWhileStack.push_back (RWS);
538
536
539
- } else if (auto *FS = dyn_cast<ForStmt>(S)) {
540
- assignCounter (FS, CounterExpr::Zero ());
541
- if (Expr *E = FS->getCond ().getPtrOrNull ())
542
- assignCounter (E, CounterExpr::Ref (getCurrentCounter ()));
543
- if (Expr *E = FS->getIncrement ().getPtrOrNull ())
544
- assignCounter (E, CounterExpr::Zero ());
545
- assignCounter (FS->getBody ());
546
-
547
537
} else if (auto *FES = dyn_cast<ForEachStmt>(S)) {
548
538
assignCounter (FES, CounterExpr::Zero ());
549
539
assignCounter (FES->getBody ());
@@ -593,23 +583,14 @@ struct CoverageMapping : public ASTWalker {
593
583
(void ) RWS;
594
584
RepeatWhileStack.pop_back ();
595
585
596
- } else if (auto *FS = dyn_cast<ForStmt>(S)) {
597
- // Both the condition and the increment are reached through the backedge.
598
- if (Expr *E = FS->getCond ().getPtrOrNull ())
599
- addToCounter (E, getExitCounter ());
600
- if (Expr *E = FS->getIncrement ().getPtrOrNull ())
601
- addToCounter (E, getExitCounter ());
602
-
603
586
} else if (auto *CS = dyn_cast<ContinueStmt>(S)) {
604
587
// Continues create extra backedges, add them to the appropriate counters.
605
588
if (!isa<RepeatWhileStmt>(CS->getTarget ()))
606
589
addToCounter (CS->getTarget (), getCurrentCounter ());
607
590
if (auto *WS = dyn_cast<WhileStmt>(CS->getTarget ())) {
608
591
if (auto *E = getConditionNode (WS->getCond ()))
609
592
addToCounter (E, getCurrentCounter ());
610
- } else if (auto *FS = dyn_cast<ForStmt>(CS->getTarget ()))
611
- if (Expr *E = FS->getCond ().getPtrOrNull ())
612
- addToCounter (E, getCurrentCounter ());
593
+ }
613
594
terminateRegion (S);
614
595
615
596
} else if (auto *BS = dyn_cast<BreakStmt>(S)) {
0 commit comments