summaryrefslogtreecommitdiffstats
path: root/clang/tools/scan-build
Commit message (Collapse)AuthorAgeFilesLines
* [clang] [cmake] Add distribution install targets for remaining componentsMichal Gorny2019-10-041-4/+18
| | | | | | | | | Add install targets as necessary to install bash-autocomplete, scan-build and scan-view via LLVM_DISTRIBUTION_TARGETS. Differential Revision: https://reviews.llvm.org/D68413 llvm-svn: 373695
* Fix a perl warning: Scalar value @ArgParts[0] better written as $ArgParts[0] ↵Sylvestre Ledru2019-09-131-1/+1
| | | | | | at /usr/share/clang/scan-build-10/libexec/ccc-analyzer line 502. llvm-svn: 371832
* [analyzer] scan-build: handle --sysroot=/path in addition to --sysroot /path.Artem Dergachev2019-09-051-5/+8
| | | | | | | | | | | Current code assumes flags in CompilerLinkerOptionMap don't use =, which isn't always true. Patch by Chris Laplante! Differential Revision: https://reviews.llvm.org/D66569 llvm-svn: 371002
* [analyzer] Analysis: Fix checker silencingCsaba Dabis2019-08-241-5/+8
| | | | llvm-svn: 369845
* [analyzer] Analysis: Silence checkersCsaba Dabis2019-08-161-3/+15
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch introduces a new `analyzer-config` configuration: `-analyzer-config silence-checkers` which could be used to silence the given checkers. It accepts a semicolon separated list, packed into quotation marks, e.g: `-analyzer-config silence-checkers="core.DivideZero;core.NullDereference"` It could be used to "disable" core checkers, so they model the analysis as before, just if some of them are too noisy it prevents to emit reports. This patch also adds support for that new option to the scan-build. Passing the option `-disable-checker core.DivideZero` to the scan-build will be transferred to `-analyzer-config silence-checkers=core.DivideZero`. Reviewed By: NoQ, Szelethus Differential Revision: https://reviews.llvm.org/D66042 llvm-svn: 369078
* [analyzer] Fix scan-build's plist output in plist-html mode.Artem Dergachev2019-08-081-1/+1
| | | | | | | r366941 accidentally made it delete all plist files as soon as they're produced. llvm-svn: 368338
* Fix exporting SARIF files from scan-build on Windows.Aaron Ballman2019-07-241-2/+2
| | | | | | | | In Perl, -z is defined as checking if a "file has zero size" and makes no mention what it does when given a directory. It looks like the behavior differs across platforms, which is why on Windows the SARIF file was always being deleted. Patch by Joe Ranieri. llvm-svn: 366941
* [analyzer] Teach scan-build to find clang when installed in /usr/local/bin/Devin Coughlin2019-03-161-2/+21
| | | | | | | | | | | | | Change scan-build to support the scenario where scan-build is installed in $TOOLCHAIN/usr/local/bin/ but clang itself is installed in $TOOLCHAIN/usr/bin/. This is restricted to when 'xcrun' is present; that is, on the Mac. rdar://problem/48914634 Differential Revision: https://reviews.llvm.org/D59406 llvm-svn: 356308
* [tools] Fix python DeprecationWarning: invalid escape sequenceSerge Guelton2019-02-111-1/+1
| | | | | | | | | | | | | | | | | | | The python documentation says "it’s highly recommended that you use raw strings for all but the simplest expressions." (https://docs.python.org/3/library/re.html) So do that with the attached patch generated by sed -i -e "s/re.search('/re.search(r'/g" $(git grep -l 're.search(') The warning can be seen in e.g. python3.7: $ python3.7 -Wd >>> import re; re.search('\s', '') <stdin>:1: DeprecationWarning: invalid escape sequence \s Commited on behalf of Marco Falke. Differential Revision: https://reviews.llvm.org/D57528 llvm-svn: 353707
* Update the license header in this man-page file.Chandler Carruth2019-01-191-2/+3
| | | | | | | | | It contains an `$Id$` expansion and so can only be updated from a true Subversion client. See the details of this update in r351636. llvm-svn: 351640
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-192-8/+6
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Update the scan-build to generate SARIF.Aaron Ballman2018-12-132-4/+19
| | | | | | This updates the scan-build perl script to allow outputting to sarif in a more natural fashion by specifying -sarif as a command line argument, similar to how -plist is already supported. llvm-svn: 349082
* [analyzer] scan-build: if --status-bugs is passed, don't forget about the ↵Roman Lebedev2018-09-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | exit status of the actual build Summary: This has been bothering me for a while, but only now i have actually looked into this. I'm using one CI job for static analysis - clang static analyzers as compilers + clang-tidy via cmake. And i'd like for the build to fail if at least one of those finds issues. If clang-tidy finds issues, it will fail the build since the warnings-as-errors is set. If static analyzer finds anything, since --status-bugs is set, it will fail the build. But if clang-tidy find anything, but static analyzer does not, the build succeeds :/ Reviewers: sylvestre.ledru, alexfh, jroelofs, ygribov, george.karpenkov, krememek Reviewed By: jroelofs Subscribers: xazax.hun, szepet, a.sidorin, mikhail.ramalho, Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D52530 llvm-svn: 343105
* scan-build: Add support of the option --exclude like in scan-build-pySylvestre Ledru2018-09-171-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: To exclude thirdparty code. To test: With /tmp/foo.c ``` void test() { int x; x = 1; // warn } ``` ``` $ scan-build --exclude non-existing/ --exclude /tmp/ -v gcc -c foo.c scan-build: Using '/usr/lib/llvm-7/bin/clang' for static analysis scan-build: Emitting reports for this run to '/tmp/scan-build-2018-09-16-214531-8410-1'. foo.c:3:3: warning: Value stored to 'x' is never read x = 1; // warn ^ ~ 1 warning generated. scan-build: File '/tmp/foo.c' deleted: part of an ignored directory. scan-build: 0 bugs found. ``` Reviewers: jroelofs Reviewed By: jroelofs Subscribers: whisperity, cfe-commits Differential Revision: https://reviews.llvm.org/D52153 llvm-svn: 342359
* scan-build: remove trailing whitespacesSylvestre Ledru2018-09-161-4/+4
| | | | llvm-svn: 342351
* Also manages clang-X as tool for scan-buildSylvestre Ledru2018-09-161-1/+1
| | | | | | | | | | | | | | Summary: This will make scan-build-7 clang-7 -c foo.c &> /dev/null Reviewers: jroelofs Subscribers: kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D52151 llvm-svn: 342350
* [analyzer] Remove traces of ubigraph visualizationGeorge Karpenkov2018-09-061-5/+0
| | | | | | | | | | Ubigraph project has been dead since about 2008, and to the best of my knowledge, no one was using it. Previously, I wasn't able to launch the existing binary at all. Differential Revision: https://reviews.llvm.org/D51655 llvm-svn: 341601
* Fix typos in clangAlexander Kornienko2018-04-062-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 llvm-svn: 329399
* [scan-build] Add an option to skip overriding CC and CXX make varsJonathan Roelofs2018-01-291-4/+20
| | | | | | | | | | | | | | Autoconf and some other systems tend to add essential compilation options to CC (e.g. -std=gnu99). When running such an auto-generated makefile, scan-build does not need to change CC and CXX as they are already set to use ccc-analyzer by a configure script. Implement a new option --keep-cc as was proposed in this discussion: http://lists.llvm.org/pipermail/cfe-dev/2013-September/031832.html Patch by Paul Fertser! llvm-svn: 323665
* [analyzer] Fix -x language argument for C preprocessed sourcesJonathan Roelofs2018-01-291-2/+2
| | | | | | | | | | | | | clang's -x option doesn't accept c-cpp-output as a language (even though 463eb6ab was merged, the driver still doesn't handle that). This bug prevents testing C language projects when ccache is used. Fixes #25851. Investigation and patch by Dave Rigby. llvm-svn: 323664
* [scan-build] Patch to scan-build tool to support "--target=<value>" flagPetr Hosek2017-05-261-1/+2
| | | | | | | | | | | | | | | | | The scan-build script provided by clang can be used to detect defects in code in the compile time. However, we discovered that the "--target=<value>" flag in clang is not properly handled by this script, which results in failures when analyzing projects that have used this flag in their makefile. This single line of change allows scan-build script to properly handle the "--target=<value>" flag. Patch by Haowei Wu Differential Revision: https://reviews.llvm.org/D33263 llvm-svn: 304025
* Actually install scan-build / ccc-analyzer / c++-analyzer on windowsJonathan Roelofs2017-03-221-0/+3
| | | | | | Before, we were only installing the wrappers... oops. llvm-svn: 298549
* scan-build: Add an option to show the description in the list of defectSylvestre Ledru2016-08-011-4/+28
| | | | | | | | | | | | | | | | Summary: This patch adds an option //--show-description// to add the defect description to the list of defect. This helps to get a better understanding of the defect without opening the page. For example, this is used for Firefox: https://people.mozilla.org/~sledru/reports/fx-scan-build/ Reviewers: rizsotto.mailinglist, zaks.anna Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D22810 llvm-svn: 277328
* [analyzer] Add --force-analyze-debug-code option to scan-buildYury Gribov2016-02-182-3/+25
| | | | | | | | | | | | | | to force debug build and hopefully enable more precise warnings. Static Analyzer is much more efficient when built in debug mode (-UNDEBUG) so we advice users to enable it manually. This may be inconvenient in case of large complex projects (think about Linux distros e.g. Android or Tizen). This patch adds a flag to scan-build which inserts -UNDEBUG automatically. Differential Revision: http://reviews.llvm.org/D16200 llvm-svn: 261204
* Remove autoconf supportChris Bieneman2016-01-261-53/+0
| | | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "This is the way [autoconf] ends Not with a bang but a whimper." -T.S. Eliot Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D16472 llvm-svn: 258862
* Honor system specific paths of MAN pagesChris Bieneman2015-11-201-6/+7
| | | | | | | | | | | | | | Summary: Caught on NetBSD. Patch by: Kamil Rytarowski (krytarowski) Reviewers: beanz, jroelofs Subscribers: cfe-commits, joerg Differential Revision: http://reviews.llvm.org/D14800 llvm-svn: 253693
* Fix build... againJonathan Roelofs2015-11-131-1/+1
| | | | llvm-svn: 253081
* [scan-build] Make scan-build work whether it's installed or notJonathan Roelofs2015-11-1312-16/+17
| | | | llvm-svn: 253074
* [scan-build] Move non user-facing utilities to shareJonathan Roelofs2015-11-132-7/+7
| | | | llvm-svn: 253068
* scan-build: Fix install.NAKAMURA Takumi2015-11-131-1/+1
| | | | llvm-svn: 253016
* [scan-build] Create share directory similar to scan-view'sJonathan Roelofs2015-11-134-10/+10
| | | | llvm-svn: 252981
* [analyzer] Fix scan-build to handle missing output directories.Devin Coughlin2015-11-111-1/+3
| | | | | | | | | | | | | Cwd::abs_path has a somewhat tricky semantics: if it's operand directory does not exist, it'll return undefined (see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=257568). This may cause scan-build to silently ignore output directory (specified with -o) and use /tmp instead of trying to create directory. This tiny patch fixes the problem. A patch by Yury Gribov! Differential Revision: http://reviews.llvm.org/D14535 llvm-svn: 252797
* Hiding the scan-build and scan-view projects under the Misc folder in IDEs ↵Aaron Ballman2015-11-111-0/+1
| | | | | | instead of having them at the root view. llvm-svn: 252771
* Implement post-commit review feedback on r252662Jonathan Roelofs2015-11-101-7/+6
| | | | llvm-svn: 252664
* Implement the fix that r252641 should have beenJonathan Roelofs2015-11-101-6/+12
| | | | llvm-svn: 252662
* Fix missing CMake dependency introduced in r252474Jonathan Roelofs2015-11-101-4/+8
| | | | llvm-svn: 252641
* Fix the cmake build after r252474 broke itJonathan Roelofs2015-11-091-1/+1
| | | | llvm-svn: 252489
* Create install targets for scan-build and scan-viewJonathan Roelofs2015-11-093-2/+126
| | | | | | http://reviews.llvm.org/D14403 llvm-svn: 252474
* [analyzer] Preserve the order checkers were enabled/disabled.Anton Yartsev2015-10-281-4/+19
| | | | | | | In addition to r251524: preserve the order the checkers were enabled/disabled to be deterministic. Additionally return the number of arguments read by 'ProcessArgs' - for debug purpose. llvm-svn: 251552
* [analyzer] Make inclusion/exclusion of checkers less ambiguous.Anton Yartsev2015-10-281-6/+10
| | | | | | | | A checker may be enabled/disabled multiple times via -enable-checker and -disable-checker scan-build arguments. Currently the conflicting and repetitive arguments are passed to the analyzer as is. With this patch only the last enable/disable of a particular checker is accepted and passed to the analyzer. This change is mostly done for the upcoming 'config for scan-build' patch when multiple inclusions/exclusions of a checker are expected to be more common. llvm-svn: 251524
* [analyzer] ccc-analyzer: Fix -isystem value passing.Devin Coughlin2015-10-261-1/+1
| | | | | | | | | | | | | | | The regex for -isystem matching is broken. -[D,I,Usystem] matches "-D", "-,", "-I", "-U", "-s" "-y", etc. Besides that, "-isystem /foo" gets interpreted as "-i" with a non-empty value "system" and thus the next "/foo" argument is not read. This patch corrects the regex. This fixes PR13237 <https://llvm.org/bugs/show_bug.cgi?id=13237>. A patch by Peter Wu! Differential Revision: http://reviews.llvm.org/D13800 llvm-svn: 251312
* [analyzer] scan-build: Teach ccc-analyzer about -Xclang.Devin Coughlin2015-10-251-0/+9
| | | | | | | | | Update ccc-analyzer to forward both -Xclang and its following argument to the the compiler driver. Previously we were dropping -Xclang and forwarding the argument on its own if it matched other forwarding criteria. This caused the argument to be interpreted as a driver rather than a frontend option. llvm-svn: 251218
* [analyzer] Improved behavior if Clang was not found, part IIAnton Yartsev2015-09-161-34/+50
| | | | | | | - scan-build help: display 'Could not query Clang for the list of available checkers.' + the reason why it happened so if clang was not found. - display requested/forced help in case of --use-analyzer=Xcode. llvm-svn: 247828
* Use -f instead of -d flag for testing existing of clang executable ↵Ted Kremenek2015-09-121-2/+2
| | | | | | (http://reviews.llvm.org/D12827). llvm-svn: 247510
* [analyzer] Improve behavior if Clang not found.Anton Yartsev2015-09-111-31/+33
| | | | | | | - Eliminate 'No such file or directory at scan-build line ...' error if '$RealBin/bin/clang' or '$RealBin/clang' directory does not exist. - Eliminate 'Use of uninitialized value $Clang in concatenation (.) or string at scan-build line ...' error if help is displayed while $Clang was not found. llvm-svn: 247466
* [analyzer] Apply whitespace cleanups by Honggyu Kim.Ted Kremenek2015-09-082-2/+2
| | | | llvm-svn: 246978
* [analyzer] Refactoring: bring together scan-build options and environment ↵Anton Yartsev2015-09-021-269/+301
| | | | | | | | | | | variables. Full list of changes: - all scan-build command-line arguments are now kept in %Options hash. - most of environment variables scan-build operates with are stored in %EnvVars hash. - moved processing of command-line arguments to the ProcessArgs subroutine. llvm-svn: 246710
* [analyzer] Fix for PR24112 (scan-build doesn't work with ↵Anton Yartsev2015-08-201-8/+14
| | | | | | | | --use-analyzer="path to clang++.exe"). Don't derive the path_to_clang++ from the path_to_clang if the path_to_clang is really the path_to_clang++. llvm-svn: 245621
* [analyzer] Incorrect env variable replaced.Anton Yartsev2015-08-111-1/+1
| | | | llvm-svn: 244673
* [Static Analyzer] Add --analyzer-target option to scan-build.Ted Kremenek2015-08-082-1/+37
| | | | | | | | | | | | | | When interposing on a compiler doing cross-compilation, scan-build does not infer the target triple needed to pass to clang for doing static analysis. The --analyzer-target option allows one to manually specify the target triple used during static analysis (and only static analysis) for such cases. Patch by Honggyu Kim! Reviewed in http://reviews.llvm.org/D10356. llvm-svn: 244400
OpenPOWER on IntegriCloud