Merge "Use new clang scan-build script."

This commit is contained in:
Chih-hung Hsieh
2016-02-25 17:16:54 +00:00
committed by Gerrit Code Review

View File

@@ -644,11 +644,18 @@ function getdriver()
local T="$1"
test "$WITH_STATIC_ANALYZER" = "0" && unset WITH_STATIC_ANALYZER
if [ -n "$WITH_STATIC_ANALYZER" ]; then
# Use scan-build to collect all static analyzer reports into directory
# /tmp/scan-build-yyyy-mm-dd-hhmmss-*
# The clang compiler passed by --use-analyzer here is not important.
# build/core/binary.mk will set CLANG_CXX and CLANG before calling
# c++-analyzer and ccc-analyzer.
local CLANG_VERSION=$(get_build_var LLVM_PREBUILTS_VERSION)
local BUILD_OS=$(get_build_var BUILD_OS)
local CLANG_DIR="$T/prebuilts/clang/host/${BUILD_OS}-x86/${CLANG_VERSION}"
echo "\
$T/prebuilts/misc/linux-x86/analyzer/tools/scan-build/scan-build \
--use-analyzer $T/prebuilts/misc/linux-x86/analyzer/bin/analyzer \
--status-bugs \
--top=$T"
${CLANG_DIR}/tools/scan-build/bin/scan-build \
--use-analyzer ${CLANG_DIR}/bin/clang \
--status-bugs"
fi
}