Deprecation warnings for C-style for loops

Warns of deprecation, checks all the appropriate bits to see if we can
do an automatic fix, and generates fix-its if that is valid.

Also adds a note if the loop looks like it ought to be a simple
for-each, but really isn’t because the loop var is modified inside the
loop.
This commit is contained in:
gregomni
2015-12-14 23:22:41 -08:00
parent f7fd6d4f59
commit 392a1ff0ed
8 changed files with 212 additions and 44 deletions

View File

@@ -800,6 +800,9 @@ public:
SourceLoc getStartLoc() const { return getLabelLocOrKeywordLoc(ForLoc); }
SourceLoc getEndLoc() const { return Body->getEndLoc(); }
SourceLoc getFirstSemicolonLoc() const { return Semi1Loc; }
SourceLoc getSecondSemicolonLoc() const { return Semi2Loc; }
NullablePtr<Expr> getInitializer() const { return Initializer; }
void setInitializer(Expr *V) { Initializer = V; }