diff options
author | andybons <andybons@chromium.org> | 2015-08-25 09:51:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-25 16:51:40 +0000 |
commit | 222c4ee3d222aca05d3c866c0bfdfd3e8346fc82 (patch) | |
tree | 0271384d911c147544c6ea085860765b586d72e9 /docs/clang_static_analyzer.md | |
parent | 788460a4da28f888f290def06948d35bf7219235 (diff) | |
download | chromium_src-222c4ee3d222aca05d3c866c0bfdfd3e8346fc82.zip chromium_src-222c4ee3d222aca05d3c866c0bfdfd3e8346fc82.tar.gz chromium_src-222c4ee3d222aca05d3c866c0bfdfd3e8346fc82.tar.bz2 |
A batch of docs style fixes.
R=nodir
BUG=524256
Review URL: https://codereview.chromium.org/1318503005
Cr-Commit-Position: refs/heads/master@{#345353}
Diffstat (limited to 'docs/clang_static_analyzer.md')
-rw-r--r-- | docs/clang_static_analyzer.md | 53 |
1 files changed, 35 insertions, 18 deletions
diff --git a/docs/clang_static_analyzer.md b/docs/clang_static_analyzer.md index 84179f8..0ddf786 100644 --- a/docs/clang_static_analyzer.md +++ b/docs/clang_static_analyzer.md @@ -1,9 +1,18 @@ -See the [official clang static analyzer page](http://clang-analyzer.llvm.org/) for background. +# The Clang Static Analyzer -We don't run this regularly (because the analyzer's [support for C++ isn't great yet](http://clang-analyzer.llvm.org/dev_cxx.html)), so everything on this page is likely broken. The last time I checked, the analyzer reported mostly uninteresting things. This assumes you're [building chromium with clang](Clang.md). +See the [official clang static analyzer page](http://clang-analyzer.llvm.org/) +for background. -You need an llvm checkout to get `scan-build` and `scan-view`; the easiest way to get that is to run -``` +We don't run this regularly (because the analyzer's +[support for C++ isn't great yet](http://clang-analyzer.llvm.org/dev_cxx.html)), +so everything on this page is likely broken. The last time I checked, the +analyzer reported mostly uninteresting things. This assumes you're +[building chromium with clang](clang.md). + +You need an llvm checkout to get `scan-build` and `scan-view`; the easiest way +to get that is to run + +```shell tools/clang/scripts/update.sh --force-local-build --without-android ``` @@ -21,36 +30,44 @@ third_party/llvm/tools/clang/tools/scan-build/scan-build \ (`builddir_name` is set to force a clobber build.) -Once that's done, run `third_party/llvm/tools/clang/tools/scan-view/scan-view` to see the results; pass in the pass that `scan-build` outputs. +Once that's done, run `third_party/llvm/tools/clang/tools/scan-view/scan-view` +to see the results; pass in the pass that `scan-build` outputs. ## With ninja -scan-build does its stuff by mucking with $CC/$CXX, which ninja ignores. gyp does look at $CC/$CXX however, so you need to first run gyp\_chromium under scan-build: -``` +scan-build does its stuff by mucking with $CC/$CXX, which ninja ignores. gyp +does look at $CC/$CXX however, so you need to first run gyp\_chromium under +scan-build: + +```shell time GYP_GENERATORS=ninja \ -GYP_DEFINES='component=shared_library clang_use_chrome_plugins=0 mac_strip_release=0 dcheck_always_on=1' \ +GYP_DEFINES='component=shared_library clang_use_chrome_plugins=0 \ + mac_strip_release=0 dcheck_always_on=1' \ third_party/llvm/tools/clang/tools/scan-build/scan-build \ --use-analyzer $PWD/third_party/llvm-build/Release+Asserts/bin/clang \ build/gyp_chromium -Goutput_dir=out_analyze ``` + You then need to run the build under scan-build too, to get a HTML report: -``` -time third_party/llvm/tools/clang/tools/scan-build/scan-build \ + +```shell +time third_party/llvm/tools/clang/tools/scan-build/scan-build \ --use-analyzer $PWD/third_party/llvm-build/Release+Asserts/bin/clang \ ninja -C out_analyze/Release/ base ``` + Then run `scan-view` as described above. ## Known False Positives - * http://llvm.org/bugs/show_bug.cgi?id=11425 +* http://llvm.org/bugs/show_bug.cgi?id=11425 ## Stuff found by the static analyzer - * http://code.google.com/p/skia/issues/detail?id=399 - * http://code.google.com/p/skia/issues/detail?id=400 - * http://codereview.chromium.org/8308008/ - * http://codereview.chromium.org/8313008/ - * http://codereview.chromium.org/8308009/ - * http://codereview.chromium.org/10031018/ - * https://codereview.chromium.org/12390058/
\ No newline at end of file +* https://code.google.com/p/skia/issues/detail?id=399 +* https://code.google.com/p/skia/issues/detail?id=400 +* https://codereview.chromium.org/8308008/ +* https://codereview.chromium.org/8313008/ +* https://codereview.chromium.org/8308009/ +* https://codereview.chromium.org/10031018/ +* https://codereview.chromium.org/12390058/ |