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

Issue 2729503004: Add Clang static analysis control to all assert functions in logging.h (Closed)

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

Description

Add Clang static analysis control to all assert functions in logging.h This CL adds static analysis hints to all assertion functions in logging.h. On builds with static analysis enabled, ANALYSIS_ASSUME_TRUE generates code which prevents the analyzer from evaluating codepaths that are asserted to be impossible. R=brucedawson@chromium.org,danakj@chromium.org BUG=327707 Review-Url: https://codereview.chromium.org/2729503004 Cr-Commit-Position: refs/heads/master@{#466129} Committed: https://chromium.googlesource.com/chromium/src/+/fe2f09f858b77a7bd9437ef3b377e9af7f50f62d

Patch Set 1 #

Patch Set 2 : Comment #

Patch Set 3 : Forced Windows check for trybot MSVC verification #

Patch Set 4 : rebase and re-add constexpr #

Patch Set 5 : Make Windows happy #

Patch Set 6 : . #

Patch Set 7 : Re-upload patch with base branch #

Patch Set 8 : Add missing close paran to EAT_STREAM_PARAMETERS #

Patch Set 9 : Resolved "else" ambiguity in DCHECK_OP impl #

Patch Set 10 : Move ANALYSIS_ASSUME_TRUE into body of CheckXYZImpl #

Total comments: 8

Patch Set 11 : brucedawson feedback #

Patch Set 12 : single evaluation of MSVC analysis_assume param #

Patch Set 13 : Added MSVC2017 workaround #

Patch Set 14 : Tweaks for MSVC 2017 #

Patch Set 15 : Added inline DoNothing() call for analysis-disabled builds #

Patch Set 16 : DCHECK impl on static build whack-a-mole. #

Patch Set 17 : Restore PREfast parallel implementations. #

Patch Set 18 : Fixed up the code comments a bit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -33 lines) Patch
M base/logging.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +42 lines, -33 lines 0 comments Download

Messages

Total messages: 77 (53 generated)
Kevin M
3 years, 9 months ago (2017-03-02 22:54:07 UTC) #2
danakj
Bots look unhappy, should I wait for that to get sorted?
3 years, 9 months ago (2017-03-03 18:41:36 UTC) #9
brucedawson
On 2017/03/03 18:41:36, danakj wrote: > Bots look unhappy, should I wait for that to ...
3 years, 9 months ago (2017-03-03 19:11:50 UTC) #10
Kevin M
I'm close to having my own Win box up and running with MSVC, so I'll ...
3 years, 9 months ago (2017-03-10 22:14:34 UTC) #11
Kevin M
Reviewers, PTAL. I have verified the changes with the PREfast and Clang analyzers. Will use ...
3 years, 9 months ago (2017-03-14 20:25:53 UTC) #17
brucedawson
On 2017/03/14 20:25:53, Kevin M wrote: > Reviewers, PTAL. I have verified the changes with ...
3 years, 9 months ago (2017-03-15 00:23:51 UTC) #26
Kevin M
Just fixed the issue which manifested on release builds with DCHECK_ALWAYS_ON. Trying again.
3 years, 9 months ago (2017-03-15 00:27:15 UTC) #29
Kevin M
Nevermind, the game of compiler whack-a-mole continues...
3 years, 9 months ago (2017-03-15 00:40:10 UTC) #32
Kevin M
OK, PTAL. Looks like I've appeased all three compilers (clang, msvc, cc1plus) with this latest ...
3 years, 9 months ago (2017-03-15 23:46:31 UTC) #37
brucedawson
A few comments and questions. https://codereview.chromium.org/2729503004/diff/160002/base/logging.h File base/logging.h (right): https://codereview.chromium.org/2729503004/diff/160002/base/logging.h#newcode301 base/logging.h:301: // errors will be ...
3 years, 9 months ago (2017-03-16 20:15:41 UTC) #38
Kevin M
https://codereview.chromium.org/2729503004/diff/160002/base/logging.h File base/logging.h (right): https://codereview.chromium.org/2729503004/diff/160002/base/logging.h#newcode301 base/logging.h:301: // errors will be generated for the current path. ...
3 years, 9 months ago (2017-03-16 23:08:14 UTC) #39
brucedawson
> I adapted the MSVC #ifdef to use an AnalysisAssumeTrue() function a la Clang, > ...
3 years, 9 months ago (2017-03-17 21:42:42 UTC) #44
Kevin M
> I think we've been here before - doesn't this lead us to the problem ...
3 years, 9 months ago (2017-03-18 00:10:35 UTC) #45
Kevin M
3 years, 9 months ago (2017-03-20 16:53:49 UTC) #46
brucedawson
On 2017/03/18 00:10:35, Kevin M wrote: > > I think we've been here before - ...
3 years, 9 months ago (2017-03-20 23:29:23 UTC) #47
Kevin M
Done. Will verify it on MSVS 2k7 when the Microsoft account SMS verification starts working ...
3 years, 9 months ago (2017-03-23 01:00:39 UTC) #48
brucedawson
On 2017/03/23 01:00:39, Kevin M wrote: > Done. Will verify it on MSVS 2k7 when ...
3 years, 9 months ago (2017-03-23 01:07:34 UTC) #49
Kevin M
It appears that merging MSVC and Clang's approaches into a single macro in a way ...
3 years, 8 months ago (2017-04-19 22:13:16 UTC) #63
Kevin M
danakj, brucedawson: PTAL The PREfast logging function variants are back. I verified that the analysis ...
3 years, 8 months ago (2017-04-19 23:43:23 UTC) #65
danakj
I'll give it a stamp when bruce is happy
3 years, 8 months ago (2017-04-20 19:25:31 UTC) #70
brucedawson
lgtm
3 years, 8 months ago (2017-04-20 20:51:09 UTC) #71
danakj
LGTM
3 years, 8 months ago (2017-04-20 20:51:53 UTC) #72
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/2729503004/330001
3 years, 8 months ago (2017-04-20 20:56:13 UTC) #74
commit-bot: I haz the power
3 years, 8 months ago (2017-04-20 21:05:44 UTC) #77
Message was sent while issue was closed.
Committed patchset #18 (id:330001) as
https://chromium.googlesource.com/chromium/src/+/fe2f09f858b77a7bd9437ef3b377...

Powered by Google App Engine
This is Rietveld 408576698