mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Change do-while to repeat-while.
Change all uses of "do { ... } while <cond>" to use "repeat" instead.
Rename DoWhileStmt to RepeatWhileStmt. Add diagnostic suggesting change
of 'do' to 'repeat' if a condition is found afterwards.
<rdar://problem/20336424> rename do/while loops to repeat/while & introduce "repeat <count> {}" loops
Swift SVN r27650
This commit is contained in:
@@ -61,8 +61,8 @@ struct MapRegionCounters : public ASTWalker {
|
||||
CounterMap[IS->getThenStmt()] = NextCounter++;
|
||||
} else if (auto *WS = dyn_cast<WhileStmt>(S)) {
|
||||
CounterMap[WS->getBody()] = NextCounter++;
|
||||
} else if (auto *DWS = dyn_cast<DoWhileStmt>(S)) {
|
||||
CounterMap[DWS->getBody()] = NextCounter++;
|
||||
} else if (auto *RWS = dyn_cast<RepeatWhileStmt>(S)) {
|
||||
CounterMap[RWS->getBody()] = NextCounter++;
|
||||
} else if (auto *FS = dyn_cast<ForStmt>(S)) {
|
||||
CounterMap[FS->getBody()] = NextCounter++;
|
||||
} else if (auto *FES = dyn_cast<ForEachStmt>(S)) {
|
||||
@@ -443,9 +443,9 @@ public:
|
||||
assignCounter(E, CounterExpr::Ref(getCurrentCounter()));
|
||||
assignCounter(WS->getBody());
|
||||
|
||||
} else if (auto *DWS = dyn_cast<DoWhileStmt>(S)) {
|
||||
assignCounter(DWS, CounterExpr::Zero());
|
||||
assignCounter(DWS->getBody());
|
||||
} else if (auto *RWS = dyn_cast<RepeatWhileStmt>(S)) {
|
||||
assignCounter(RWS, CounterExpr::Zero());
|
||||
assignCounter(RWS->getBody());
|
||||
|
||||
} else if (auto *FS = dyn_cast<ForStmt>(S)) {
|
||||
assignCounter(FS, CounterExpr::Zero());
|
||||
|
||||
Reference in New Issue
Block a user