This is an archive of the discontinued LLVM Phabricator instance.

Add -Wfor-loop-analysis to -Wall.
ClosedPublic

Authored by thakis on Jan 6 2016, 10:54 AM.

Details

Summary

Every time I try this warning, it finds a few bugs (I think about 4 total in Chromium so far), with 0 false positives. I couldn't measure any build performance degradation when turning it on; I tried building clang itself with and without the warning, and a small-ish target in chromium (1.6k TUs).

It should be in -Wall, and possibly even make its way into a default warning at some point.

Diff Detail

Event Timeline

thakis updated this revision to Diff 44132.Jan 6 2016, 10:54 AM
thakis retitled this revision from to Add -Wfor-loop-analysis to -Wall..
thakis updated this object.
thakis added a reviewer: rtrieu.
thakis added a subscriber: cfe-commits.
rtrieu accepted this revision.Jan 6 2016, 12:43 PM
rtrieu edited edge metadata.

LGTM

The most complex things these warnings use is an AST visitor, so the compile time impact should be minimal.

This revision is now accepted and ready to land.Jan 6 2016, 12:43 PM
aaron.ballman accepted this revision.Jan 6 2016, 12:48 PM
aaron.ballman added a reviewer: aaron.ballman.
aaron.ballman added a subscriber: aaron.ballman.

LGTM as well, FWIW

thakis closed this revision.Jan 6 2016, 12:58 PM

r256975, thanks!