[PATCH] D40242: Do not perform the analysis based warning if all warnings are ignored

2017-11-23 Thread Olivier Goffart via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL318900: Do not perform the analysis based warning if the warnings are ignored (authored by ogoffart). Changed prior to commit: https://reviews.llvm.org/D40242?vs=123720=124041#toc Repository: rL

[PATCH] D40242: Do not perform the analysis based warning if all warnings are ignored

2017-11-21 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! https://reviews.llvm.org/D40242 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D40242: Do not perform the analysis based warning if all warnings are ignored

2017-11-20 Thread Olivier Goffart via Phabricator via cfe-commits
ogoffart updated this revision to Diff 123720. ogoffart added a comment. Herald added a subscriber: klimek. I added a test. I did not add such test before because i know that calling Reset() on the diagnostics is kind of a hack. This change does not have any behavioral difference normally, it

[PATCH] D40242: Do not perform the analysis based warning if all warnings are ignored

2017-11-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D40242#931173, @ogoffart wrote: > > You should add a test case that demonstrates code which would otherwise > > trigger an analysis-based warning but doesn't due to disabling all warnings. > > No warnings are triggered. Because the

[PATCH] D40242: Do not perform the analysis based warning if all warnings are ignored

2017-11-20 Thread Olivier Goffart via Phabricator via cfe-commits
ogoffart marked an inline comment as done. ogoffart added a comment. > You should add a test case that demonstrates code which would otherwise > trigger an analysis-based warning but doesn't due to disabling all warnings. No warnings are triggered. Because the diagnostic engine ignores them.

[PATCH] D40242: Do not perform the analysis based warning if all warnings are ignored

2017-11-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. You should add a test case that demonstrates code which would otherwise trigger an analysis-based warning but doesn't due to disabling all warnings. https://reviews.llvm.org/D40242 ___ cfe-commits mailing list

[PATCH] D40242: Do not perform the analysis based warning if all warnings are ignored

2017-11-20 Thread Olivier Goffart via Phabricator via cfe-commits
ogoffart marked an inline comment as done. ogoffart added inline comments. Comment at: lib/Sema/AnalysisBasedWarnings.cpp:2084 + // Do not do any analysis if we are going to just ignore them. + if (Diags.getIgnoreAllWarnings() || + (Diags.getSuppressSystemWarnings() &&

[PATCH] D40242: Do not perform the analysis based warning if all warnings are ignored

2017-11-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D40242#930125, @ogoffart wrote: > I do not know how to add a test: there is no real visible change for clang. > It just should be faster when passing "-w". Oh right, i was thinking of something else there. Comment at:

[PATCH] D40242: Do not perform the analysis based warning if all warnings are ignored

2017-11-20 Thread Olivier Goffart via Phabricator via cfe-commits
ogoffart added a comment. I do not know how to add a test: there is no real visible change for clang. It just should be faster when passing "-w". https://reviews.llvm.org/D40242 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D40242: Do not perform the analysis based warning if all warnings are ignored

2017-11-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. You probably want to add a test for this. https://reviews.llvm.org/D40242 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D40242: Do not perform the analysis based warning if all warnings are ignored

2017-11-20 Thread Olivier Goffart via Phabricator via cfe-commits
ogoffart created this revision. Do not perform the analysis based warning if all warnings are ignored. This saves some cycles when compiling with "-w". But more importantly, for my tool, this fixes a potential crash which may happen on invalid code. Because the analysis might compute the CFG