Also manages clang-X as tool for scan-build see https://reviews.llvm.org/D52151

This commit is contained in:
Sylvestre Ledru 2018-09-16 20:49:41 +02:00
parent 4ab69d5d72
commit f32196f68e
4 changed files with 29 additions and 0 deletions

7
debian/changelog vendored
View File

@ -1,3 +1,10 @@
llvm-toolchain-7 (1:7~+rc3-6) unstable; urgency=medium
* Also manages clang-X as tool for scan-build
see https://reviews.llvm.org/D52151
--
llvm-toolchain-7 (1:7~+rc3-5) unstable; urgency=medium
[ John Paul Adrian Glaubitz ]

13
debian/patches/scan-build-clang-X.diff vendored Normal file
View File

@ -0,0 +1,13 @@
Index: llvm-toolchain-7_7~+rc1/clang/tools/scan-build/bin/scan-build
===================================================================
--- llvm-toolchain-7_7~+rc1.orig/clang/tools/scan-build/bin/scan-build
+++ llvm-toolchain-7_7~+rc1/clang/tools/scan-build/bin/scan-build
@@ -1079,7 +1079,7 @@ sub RunBuildCommand {
if ($Cmd =~ /(.*\/?gcc[^\/]*$)/ or
$Cmd =~ /(.*\/?cc[^\/]*$)/ or
$Cmd =~ /(.*\/?llvm-gcc[^\/]*$)/ or
- $Cmd =~ /(.*\/?clang$)/ or
+ $Cmd =~ /(.*\/?clang[^\/]*$)/ or
$Cmd =~ /(.*\/?ccc-analyzer[^\/]*$)/) {
if (!($Cmd =~ /ccc-analyzer/) and !defined $ENV{"CCC_CC"}) {

View File

@ -74,3 +74,4 @@ libcxx-silent-failure-arm64.diff
D51108-rust-powerpc.diff
disable-sse2-old-x86.diff
scan-build-clang-X.diff

View File

@ -27,6 +27,14 @@ if ! ./foo 2>&1 | grep -q heap-use-after-free ; then
echo "sanitize=address is failing"
exit 42
fi
echo '
void test() {
int x;
x = 1; // warn
}
'> foo.c
scan-build-$VERSION gcc -c foo.c &> /dev/null
scan-build-$VERSION clang-$VERSION -c foo.c &> /dev/null
echo 'int main() {return 0;}' > foo.c
clang-$VERSION foo.c