scan-build: Add support of the option --exclude like in scan-build-py
authorSylvestre Ledru <sylvestre@debian.org>
Mon, 17 Sep 2018 06:31:46 +0000 (06:31 +0000)
committerSylvestre Ledru <sylvestre@debian.org>
Mon, 17 Sep 2018 06:31:46 +0000 (06:31 +0000)
commitae48d78054b0f8482995bab426e950382b644714
tree30dad5b444f2e7c46d9d8a4fb8a8f4516df566f3
parent00f51c0904dac4983d196e04bffac062edb25511
scan-build: Add support of the option --exclude like in scan-build-py

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
clang/tools/scan-build/bin/scan-build