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

Issue 2617283002: Add Clang static analyzer to Clang toolchain defs in GN (Closed)

Created:
3 years, 11 months ago by Kevin M
Modified:
3 years, 11 months ago
Reviewers:
Nico, sdefresne, Wez
CC:
chromium-reviews, Wez
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add Clang static analyzer support to Clang toolchain defs in GN. If "use_clang_static_analyzer" is enabled in args.gn, Clang builds will redirect compilation to use Clang's ccc-analyzer and cxx-analyzer for static analysis. Review-Url: https://codereview.chromium.org/2617283002 Cr-Commit-Position: refs/heads/master@{#445854} Committed: https://chromium.googlesource.com/chromium/src/+/520f95147c821e13003362194a5de003a9f5c8f9

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : gni comment #

Total comments: 10

Patch Set 4 : wez feedback #

Total comments: 1

Patch Set 5 : wez feedback #

Patch Set 6 : Modified Mac toolchain gni #

Patch Set 7 : rebase #

Patch Set 8 : . #

Total comments: 6

Patch Set 9 : sylvain feedback #

Total comments: 23

Patch Set 10 : wez/thakis feedback #

Total comments: 2

Patch Set 11 : wez feedback #

Total comments: 4

Patch Set 12 : thakis feedback #

Total comments: 1

Patch Set 13 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+127 lines, -67 lines) Patch
M DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +7 lines, -0 lines 0 comments Download
A build/toolchain/clang_static_analyzer.gni View 1 2 3 4 5 6 7 8 9 1 chunk +11 lines, -0 lines 0 comments Download
A build/toolchain/clang_static_analyzer_wrapper.py View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +61 lines, -0 lines 0 comments Download
M build/toolchain/gcc_toolchain.gni View 1 2 3 4 5 6 7 8 9 2 chunks +16 lines, -0 lines 0 comments Download
M build/toolchain/mac/BUILD.gn View 1 2 3 4 5 6 7 8 9 2 chunks +18 lines, -1 line 0 comments Download
M build/toolchain/wrapper_utils.py View 11 1 chunk +3 lines, -4 lines 0 comments Download
M docs/clang_static_analyzer.md View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +11 lines, -62 lines 0 comments Download

Messages

Total messages: 41 (19 generated)
Kevin M
3 years, 11 months ago (2017-01-09 17:56:48 UTC) #1
Kevin M
3 years, 11 months ago (2017-01-09 23:18:27 UTC) #4
Wez
https://codereview.chromium.org/2617283002/diff/40001/build/toolchain/clang_static_analyzer_wrapper.py File build/toolchain/clang_static_analyzer_wrapper.py (right): https://codereview.chromium.org/2617283002/diff/40001/build/toolchain/clang_static_analyzer_wrapper.py#newcode37 build/toolchain/clang_static_analyzer_wrapper.py:37: if args.clang_cxx_path != None: Should we assert that clang_cc_path ...
3 years, 11 months ago (2017-01-10 02:41:49 UTC) #6
sdefresne
https://codereview.chromium.org/2617283002/diff/60001/build/toolchain/gcc_toolchain.gni File build/toolchain/gcc_toolchain.gni (right): https://codereview.chromium.org/2617283002/diff/60001/build/toolchain/gcc_toolchain.gni#newcode490 build/toolchain/gcc_toolchain.gni:490: if (use_clang_static_analyzer) { You'll also need to add this ...
3 years, 11 months ago (2017-01-10 09:06:05 UTC) #7
Kevin M
https://codereview.chromium.org/2617283002/diff/40001/build/toolchain/clang_static_analyzer_wrapper.py File build/toolchain/clang_static_analyzer_wrapper.py (right): https://codereview.chromium.org/2617283002/diff/40001/build/toolchain/clang_static_analyzer_wrapper.py#newcode37 build/toolchain/clang_static_analyzer_wrapper.py:37: if args.clang_cxx_path != None: On 2017/01/10 02:41:48, Wez wrote: ...
3 years, 11 months ago (2017-01-10 19:12:27 UTC) #8
Kevin M
Sylvain, can you check if this works for you on your Mac?
3 years, 11 months ago (2017-01-11 00:53:46 UTC) #10
sdefresne
With the suggested changes, I'm able to build (with use_goma = false) and I see ...
3 years, 11 months ago (2017-01-11 16:49:11 UTC) #18
Kevin M
I haven't yet been able to replicate the report summarization and ephemeral output directory behavior ...
3 years, 11 months ago (2017-01-11 18:23:54 UTC) #19
sdefresne
On 2017/01/11 18:23:54, Kevin M wrote: > I haven't yet been able to replicate the ...
3 years, 11 months ago (2017-01-11 18:27:16 UTC) #20
Kevin M
https://codereview.chromium.org/2617283002/diff/140001/build/toolchain/mac/BUILD.gn File build/toolchain/mac/BUILD.gn (left): https://codereview.chromium.org/2617283002/diff/140001/build/toolchain/mac/BUILD.gn#oldcode173 build/toolchain/mac/BUILD.gn:173: command = "$env_wrapper $cc -MMD -MF $depfile {{defines}} {{include_dirs}} ...
3 years, 11 months ago (2017-01-11 18:27:46 UTC) #21
Nico
This looks nice. https://codereview.chromium.org/2617283002/diff/160001/base/logging.h File base/logging.h (right): https://codereview.chromium.org/2617283002/diff/160001/base/logging.h#newcode732 base/logging.h:732: // otherwise false positive errors may ...
3 years, 11 months ago (2017-01-11 20:20:06 UTC) #22
Wez
https://codereview.chromium.org/2617283002/diff/40001/build/toolchain/clang_static_analyzer_wrapper.py File build/toolchain/clang_static_analyzer_wrapper.py (right): https://codereview.chromium.org/2617283002/diff/40001/build/toolchain/clang_static_analyzer_wrapper.py#newcode67 build/toolchain/clang_static_analyzer_wrapper.py:67: return run_command(args.clang_cxx_path, compile_args) On 2017/01/10 19:12:27, Kevin M wrote: ...
3 years, 11 months ago (2017-01-14 00:04:59 UTC) #23
Kevin M
https://codereview.chromium.org/2617283002/diff/160001/base/logging.h File base/logging.h (right): https://codereview.chromium.org/2617283002/diff/160001/base/logging.h#newcode732 base/logging.h:732: // otherwise false positive errors may be generated by ...
3 years, 11 months ago (2017-01-18 23:04:32 UTC) #24
Kevin M
Ping
3 years, 11 months ago (2017-01-19 23:13:16 UTC) #29
Wez
LGTM w/ nits - thanks for doing this, Kevin; looks awesome. https://codereview.chromium.org/2617283002/diff/160001/build/toolchain/clang_static_analyzer_wrapper.py File build/toolchain/clang_static_analyzer_wrapper.py (right): ...
3 years, 11 months ago (2017-01-21 01:10:15 UTC) #30
Kevin M
https://codereview.chromium.org/2617283002/diff/160001/build/toolchain/clang_static_analyzer_wrapper.py File build/toolchain/clang_static_analyzer_wrapper.py (right): https://codereview.chromium.org/2617283002/diff/160001/build/toolchain/clang_static_analyzer_wrapper.py#newcode36 build/toolchain/clang_static_analyzer_wrapper.py:36: assert ((args.clang_cc_path != None) or (args.clang_cxx_path != None)) On ...
3 years, 11 months ago (2017-01-24 01:20:49 UTC) #31
Kevin M
Friendly ping
3 years, 11 months ago (2017-01-24 20:26:21 UTC) #32
Nico
Still looks good, but one question: https://codereview.chromium.org/2617283002/diff/200001/build/toolchain/gcc_compile_wrapper.py File build/toolchain/gcc_compile_wrapper.py (right): https://codereview.chromium.org/2617283002/diff/200001/build/toolchain/gcc_compile_wrapper.py#newcode31 build/toolchain/gcc_compile_wrapper.py:31: used_resources = wrapper_utils.ExtractResourceIdsFromPragmaWarnings(stderr) ...
3 years, 11 months ago (2017-01-24 21:41:33 UTC) #33
Kevin M
https://codereview.chromium.org/2617283002/diff/200001/build/toolchain/gcc_compile_wrapper.py File build/toolchain/gcc_compile_wrapper.py (right): https://codereview.chromium.org/2617283002/diff/200001/build/toolchain/gcc_compile_wrapper.py#newcode31 build/toolchain/gcc_compile_wrapper.py:31: used_resources = wrapper_utils.ExtractResourceIdsFromPragmaWarnings(stderr) On 2017/01/24 21:41:33, Nico wrote: > ...
3 years, 11 months ago (2017-01-24 21:46:18 UTC) #34
Nico
lgtm https://codereview.chromium.org/2617283002/diff/220001/DEPS File DEPS (right): https://codereview.chromium.org/2617283002/diff/220001/DEPS#newcode304 DEPS:304: nit: no additional newline here
3 years, 11 months ago (2017-01-24 21:47:53 UTC) #35
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/2617283002/240001
3 years, 11 months ago (2017-01-24 21:52:59 UTC) #38
commit-bot: I haz the power
3 years, 11 months ago (2017-01-24 23:25:54 UTC) #41
Message was sent while issue was closed.
Committed patchset #13 (id:240001) as
https://chromium.googlesource.com/chromium/src/+/520f95147c821e13003362194a5d...

Powered by Google App Engine
This is Rietveld 408576698