Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Issue 2669213005: Add new macro "ANALYZER_ASSUME_TRUE" and integrate with all assertion types. (Closed)

Created:
3 years, 10 months ago by Kevin M
Modified:
3 years, 10 months ago
Reviewers:
stanisc, Nico, Wez, brucedawson
CC:
chromium-reviews, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add new macro "ANALYZER_ASSUME_TRUE" and integrate with all assertion types. ANALYZER_ASSUME_TRUE(...) adds compiler-specific annotations that stop static analysis if an asserted condition for an analyzed codepath is untrue. Now that this macro encapsulates most of the complexity of handling analysis cases, we can trim some redundancy from logging.h. Add ANALYZER_ASSUME_TRUE() to all CHECK asserts and variants of DCHECK_OP (DCHECK_EQ, DCHECK_NE, DCHECK_LT...) BUG=687243 R=bdawson@chromium.org,thakis@chromium.org,wez@chromium.org Review-Url: https://codereview.chromium.org/2669213005 Cr-Commit-Position: refs/heads/master@{#449832} Committed: https://chromium.googlesource.com/chromium/src/+/e23eed07b41b99be905bffbbcadb0d761c40eb7d

Patch Set 1 #

Patch Set 2 : Fix wonky formatting #

Total comments: 6

Patch Set 3 : bdawson feedback #

Total comments: 5

Patch Set 4 : Make ANALYZER_ASSUME_TRUE, catch all asserts and DCHECK_OPs #

Total comments: 3

Patch Set 5 : Removed redundant prefast CHECK/DCHECK definitions #

Patch Set 6 : rebase #

Total comments: 2

Patch Set 7 : RIP RValue references #

Unified diffs Side-by-side diffs Delta from patch set Stats (+52 lines, -72 lines) Patch
M base/logging.h View 1 2 3 4 5 6 6 chunks +52 lines, -72 lines 0 comments Download

Messages

Total messages: 42 (18 generated)
Kevin M
3 years, 10 months ago (2017-02-02 20:13:55 UTC) #2
brucedawson
Comments inline. Also, as discussed at lunch, I'm not to bothered about whether or not ...
3 years, 10 months ago (2017-02-02 21:37:57 UTC) #5
Kevin M
https://codereview.chromium.org/2669213005/diff/20001/base/logging.h File base/logging.h (right): https://codereview.chromium.org/2669213005/diff/20001/base/logging.h#newcode311 base/logging.h:311: #define ANALYSIS_MARK_ASSERTION(condition) !!(condition) On 2017/02/02 21:37:57, brucedawson (slow) wrote: ...
3 years, 10 months ago (2017-02-02 21:46:44 UTC) #6
brucedawson
lgtm - with the assumption that you triple check that the sense of the conditions ...
3 years, 10 months ago (2017-02-02 21:51:29 UTC) #7
Nico
lgtm
3 years, 10 months ago (2017-02-02 22:07:01 UTC) #8
Wez
https://codereview.chromium.org/2669213005/diff/40001/base/logging.h File base/logging.h (right): https://codereview.chromium.org/2669213005/diff/40001/base/logging.h#newcode292 base/logging.h:292: // ANALYSIS_MARK_ASSERTION(...) adds compiler-specific annotations to an nit: Can ...
3 years, 10 months ago (2017-02-03 20:51:52 UTC) #9
Kevin M
PTAL. I hooked ANALYZER_ASSUME_TRUE into all the DCHECK_OP codepaths and wow - it cut down ...
3 years, 10 months ago (2017-02-03 22:37:23 UTC) #11
Wez
https://codereview.chromium.org/2669213005/diff/40001/base/logging.h File base/logging.h (right): https://codereview.chromium.org/2669213005/diff/40001/base/logging.h#newcode527 base/logging.h:527: , LAZY_STREAM(LOG_STREAM(FATAL), false) << "Check failed: " #condition ". ...
3 years, 10 months ago (2017-02-06 21:04:39 UTC) #13
Kevin M
PTAL https://codereview.chromium.org/2669213005/diff/60001/base/logging.h File base/logging.h (right): https://codereview.chromium.org/2669213005/diff/60001/base/logging.h#newcode745 base/logging.h:745: // See comments on the previous use of ...
3 years, 10 months ago (2017-02-09 23:36:25 UTC) #14
Wez
LGTM :) https://codereview.chromium.org/2669213005/diff/60001/base/logging.h File base/logging.h (right): https://codereview.chromium.org/2669213005/diff/60001/base/logging.h#newcode745 base/logging.h:745: // See comments on the previous use ...
3 years, 10 months ago (2017-02-10 00:40:45 UTC) #15
Kevin M
+R stanisc@ , who is kind enough to try building this on his Windows machine. ...
3 years, 10 months ago (2017-02-10 00:58:02 UTC) #17
Kevin M
PREfast appeared to be functioning normally on Stanislav's machine. Submitting...
3 years, 10 months ago (2017-02-10 01:14:50 UTC) #18
commit-bot: I haz the power
This CL has an open dependency (Issue 2667853004 Patch 140001). Please resolve the dependency and ...
3 years, 10 months ago (2017-02-10 01:15:25 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2669213005/100001
3 years, 10 months ago (2017-02-10 01:20:37 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/308450) linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, ...
3 years, 10 months ago (2017-02-10 07:21:52 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2669213005/100001
3 years, 10 months ago (2017-02-10 17:45:37 UTC) #29
Nico
https://codereview.chromium.org/2669213005/diff/100001/base/logging.h File base/logging.h (right): https://codereview.chromium.org/2669213005/diff/100001/base/logging.h#newcode306 base/logging.h:306: return std::forward<TVal>(arg); this looks a lot more complicated than ...
3 years, 10 months ago (2017-02-10 18:08:47 UTC) #30
Kevin M
https://codereview.chromium.org/2669213005/diff/100001/base/logging.h File base/logging.h (right): https://codereview.chromium.org/2669213005/diff/100001/base/logging.h#newcode306 base/logging.h:306: return std::forward<TVal>(arg); On 2017/02/10 18:08:47, Nico wrote: > this ...
3 years, 10 months ago (2017-02-10 18:20:09 UTC) #31
Nico
the forward() calls only happen in analyze builds, so performance shouldn't matter there, right? I ...
3 years, 10 months ago (2017-02-10 18:35:06 UTC) #33
Kevin M
I'll try to reproduce the issue that caused me to use rvalues. If I can't, ...
3 years, 10 months ago (2017-02-10 18:45:58 UTC) #34
Nico
On Fri, Feb 10, 2017 at 1:45 PM, <kmarshall@chromium.org> wrote: > I'll try to reproduce ...
3 years, 10 months ago (2017-02-10 18:46:47 UTC) #35
Kevin M
Still built w/o rvalue references; removed them
3 years, 10 months ago (2017-02-10 19:14:54 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2669213005/120001
3 years, 10 months ago (2017-02-10 22:44:01 UTC) #39
commit-bot: I haz the power
3 years, 10 months ago (2017-02-11 02:14:07 UTC) #42
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/e23eed07b41b99be905bffbbcadb...

Powered by Google App Engine
This is Rietveld 408576698