[PATCH] D13157: Teach -Wtautological-overlap-compare about enums

2015-09-24 Thread George Burgess IV via cfe-commits
george.burgess.iv created this revision. george.burgess.iv added a reviewer: rtrieu. george.burgess.iv added a subscriber: cfe-commits. Currently, -Wtautological-overlap-compare only emits warnings if the comparisons are between integer literals and variables. This patch adds support for compari

Re: [PATCH] D13157: Teach -Wtautological-overlap-compare about enums

2015-09-25 Thread Aaron Ballman via cfe-commits
aaron.ballman added a subscriber: aaron.ballman. aaron.ballman added a comment. Thank you for working on this -- I think it's a good cleanup and feature-add! I have a few minor comments, but generally LGTM. You should wait for an okay from Richard, however. Comment at: lib/Ana

Re: [PATCH] D13157: Teach -Wtautological-overlap-compare about enums

2015-09-25 Thread George Burgess IV via cfe-commits
george.burgess.iv updated this revision to Diff 35744. george.burgess.iv marked an inline comment as done. george.burgess.iv added a comment. Addressed all feedback http://reviews.llvm.org/D13157 Files: lib/Analysis/CFG.cpp test/Sema/warn-overlap.c Index: test/Sema/warn-overlap.c =

Re: [PATCH] D13157: Teach -Wtautological-overlap-compare about enums

2015-09-25 Thread George Burgess IV via cfe-commits
george.burgess.iv added inline comments. Comment at: lib/Analysis/CFG.cpp:54 @@ +53,3 @@ +auto *DR = dyn_cast(E->IgnoreParenImpCasts()); +if (DR == nullptr) + return nullptr; aaron.ballman wrote: > Please don't compare a pointer against nullptr with a

Re: [PATCH] D13157: Teach -Wtautological-overlap-compare about enums

2015-09-25 Thread Aaron Ballman via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a reviewer: aaron.ballman. aaron.ballman added a comment. This revision is now accepted and ready to land. Thanks, I think this looks good (pending confirmation from Richard). ~Aaron http://reviews.llvm.org/D13157

Re: [PATCH] D13157: Teach -Wtautological-overlap-compare about enums

2015-09-30 Thread Richard Trieu via cfe-commits
rtrieu accepted this revision. rtrieu added a comment. Fix the comments, then it should be ready to commit. Comment at: lib/Analysis/CFG.cpp:49 @@ +48,3 @@ +tryNormalizeBinaryOperator(const BinaryOperator *B) { + auto TryTransformToIntOrEnumConstant = [](const Expr *E) -> const

Re: [PATCH] D13157: Teach -Wtautological-overlap-compare about enums

2015-10-01 Thread George Burgess IV via cfe-commits
george.burgess.iv closed this revision. george.burgess.iv marked 4 inline comments as done. george.burgess.iv added a comment. Changed code to address all feedback + committed as r249053. Thanks for the reviews! Comment at: lib/Analysis/CFG.cpp:49 @@ +48,3 @@ +tryNormalizeBinar

Re: [PATCH] D13157: Teach -Wtautological-overlap-compare about enums

2015-10-01 Thread Aaron Ballman via cfe-commits
On Thu, Oct 1, 2015 at 2:50 PM, George Burgess IV wrote: > george.burgess.iv closed this revision. > george.burgess.iv marked 4 inline comments as done. > george.burgess.iv added a comment. > > Changed code to address all feedback + committed as r249053. Thanks for the > reviews! > > > ==

Re: [PATCH] D13157: Teach -Wtautological-overlap-compare about enums

2015-10-01 Thread Richard Trieu via cfe-commits
rtrieu added a comment. Next time, add > Differential Revision: to your commit and Phabricator will close the diff automatically. http://llvm.org/docs/Phabricator.html Comment at: lib/Analysis/CFG.cpp:99-104 @@ +98,8 @@ + // Currently we're only given EnumConstantDecls or

Re: [PATCH] D13157: Teach -Wtautological-overlap-compare about enums

2015-10-01 Thread Aaron Ballman via cfe-commits
On Thu, Oct 1, 2015 at 3:01 PM, Richard Trieu wrote: > rtrieu added a comment. > > Next time, add > >> Differential Revision: > > > to your commit and Phabricator will close the diff automatically. > > http://llvm.org/docs/Phabricator.html > > > > Comment at: lib/Analysis/CFG.cpp

Re: [PATCH] D13157: Teach -Wtautological-overlap-compare about enums

2015-10-01 Thread George Burgess IV via cfe-commits
> Next time, add Differential Revision: to your commit and Phabricator will close the diff automatically. Ooh, shiny. Thanks for letting me know! > Doubling the expense for assert builds so that we get a slightly better stack trace in the event our assumptions are wrong doesn't seem like a good

Re: [PATCH] D13157: Teach -Wtautological-overlap-compare about enums

2015-10-01 Thread Richard Trieu via cfe-commits
I'm in favor of keeping the asserts around. Several times, I've seen Clang crashers than languish in the bug tracker with an assert in a generic casting function. And no one fixes it until someone pokes at the backtrace to find the source of the bad pointer, at which point it gets fixed quickly.

Re: [PATCH] D13157: Teach -Wtautological-overlap-compare about enums

2015-10-02 Thread Aaron Ballman via cfe-commits
On Thu, Oct 1, 2015 at 5:18 PM, Richard Trieu wrote: > I'm in favor of keeping the asserts around. Several times, I've seen Clang > crashers than languish in the bug tracker with an assert in a generic > casting function. And no one fixes it until someone pokes at the backtrace > to find the sou

Re: [PATCH] D13157: Teach -Wtautological-overlap-compare about enums

2015-10-02 Thread David Blaikie via cfe-commits
On Fri, Oct 2, 2015 at 6:10 AM, Aaron Ballman via cfe-commits < cfe-commits@lists.llvm.org> wrote: > On Thu, Oct 1, 2015 at 5:18 PM, Richard Trieu wrote: > > I'm in favor of keeping the asserts around. Several times, I've seen > Clang > > crashers than languish in the bug tracker with an assert