summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2019-09-12 01:35:09 +0000
committerVitaly Buka <vitalybuka@google.com>2019-09-12 01:35:09 +0000
commit026867a2d6ae2744f4da3216df060db9878e503e (patch)
treec2157b3eb516e1294a7f6822c8aa92fca01a9cd3
parent6803b7babe607a18c0a05aedb04348da966ede05 (diff)
downloadcompiler-rt-026867a2d6ae2744f4da3216df060db9878e503e.tar.gz
[compiler-rt] Better lint output for .inc files
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371702 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/asan/asan_flags.inc13
-rw-r--r--lib/hwasan/hwasan_flags.inc2
-rwxr-xr-xlib/sanitizer_common/scripts/check_lint.sh16
3 files changed, 12 insertions, 19 deletions
diff --git a/lib/asan/asan_flags.inc b/lib/asan/asan_flags.inc
index d360e03ca..43c70dbca 100644
--- a/lib/asan/asan_flags.inc
+++ b/lib/asan/asan_flags.inc
@@ -139,10 +139,10 @@ ASAN_FLAG(
"If >= 2, detect operations like <, <=, >, >= and - on invalid pointer "
"pairs (e.g. when pointers belong to different objects); "
"If == 1, detect invalid operations only when both pointers are non-null.")
-ASAN_FLAG(
- bool, detect_container_overflow, true,
- "If true, honor the container overflow annotations. See "
- "https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow")
+ASAN_FLAG(bool, detect_container_overflow, true,
+ "If true, honor the container overflow annotations. See "
+ "https://github.com/google/sanitizers/wiki/"
+ "AddressSanitizerContainerOverflow")
ASAN_FLAG(int, detect_odr_violation, 2,
"If >=2, detect violation of One-Definition-Rule (ODR); "
"If ==1, detect ODR-violation only if the two variables "
@@ -158,5 +158,6 @@ ASAN_FLAG(bool, allocator_frees_and_returns_null_on_realloc_zero, true,
ASAN_FLAG(bool, verify_asan_link_order, true,
"Check position of ASan runtime in library list (needs to be disabled"
" when other library has to be preloaded system-wide)")
-ASAN_FLAG(bool, windows_hook_rtl_allocators, false,
- "(Windows only) enable hooking of Rtl(Allocate|Free|Size|ReAllocate)Heap.")
+ASAN_FLAG(
+ bool, windows_hook_rtl_allocators, false,
+ "(Windows only) enable hooking of Rtl(Allocate|Free|Size|ReAllocate)Heap.")
diff --git a/lib/hwasan/hwasan_flags.inc b/lib/hwasan/hwasan_flags.inc
index 2dff2b9ac..dffbf56cb 100644
--- a/lib/hwasan/hwasan_flags.inc
+++ b/lib/hwasan/hwasan_flags.inc
@@ -1,4 +1,4 @@
-//===-- hwasan_flags.inc ------------------------------------------*- C++ -*-===//
+//===-- hwasan_flags.inc ----------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
diff --git a/lib/sanitizer_common/scripts/check_lint.sh b/lib/sanitizer_common/scripts/check_lint.sh
index fc5bfca66..ecd61c07e 100755
--- a/lib/sanitizer_common/scripts/check_lint.sh
+++ b/lib/sanitizer_common/scripts/check_lint.sh
@@ -124,21 +124,13 @@ run_lint ${SCUDO_RTL_LINT_FILTER} ${SCUDO_RTL}/*.cpp \
${SCUDO_RTL}/*.h &
# Misc files
-FILES=${COMMON_RTL}/*.inc
-TMPFILES=""
-for FILE in $FILES; do
- TMPFILE="$(${MKTEMP}).$(basename ${FILE}).cpp"
- cp -f $FILE $TMPFILE
- run_lint ${COMMON_RTL_INC_LINT_FILTER} $TMPFILE &
- TMPFILES="$TMPFILES $TMPFILE"
-done
+rsync -a --prune-empty-dirs --exclude='*/profile/*' --exclude='*/builtins/*' --exclude='*/xray/*' --include='*/' --include='*.inc' --exclude='*' "${COMPILER_RT}/" "${MKTEMP_DIR}/"
+find ${MKTEMP_DIR} -type f -name '*.inc' -exec mv {} {}.cpp \;
+( ERROR_LOG=${ERROR_LOG}.inc run_lint ${COMMON_RTL_INC_LINT_FILTER} $(find ${MKTEMP_DIR} -type f -name '*.inc.cpp') )
+sed "s|${MKTEMP_DIR}|${COMPILER_RT}|g" ${ERROR_LOG}.inc | sed "s|.inc.cpp|.inc|g" >> ${ERROR_LOG}
wait
-for temp in $TMPFILES; do
- rm -f $temp
-done
-
if [ -s $ERROR_LOG ]; then
cat $ERROR_LOG
exit 1