[compiler-rt] r371702 - [compiler-rt] Better lint output for .inc files

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 11 18:35:09 PDT 2019


Author: vitalybuka
Date: Wed Sep 11 18:35:09 2019
New Revision: 371702

URL: http://llvm.org/viewvc/llvm-project?rev=371702&view=rev
Log:
[compiler-rt] Better lint output for .inc files

Modified:
    compiler-rt/trunk/lib/asan/asan_flags.inc
    compiler-rt/trunk/lib/hwasan/hwasan_flags.inc
    compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh

Modified: compiler-rt/trunk/lib/asan/asan_flags.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_flags.inc?rev=371702&r1=371701&r2=371702&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_flags.inc (original)
+++ compiler-rt/trunk/lib/asan/asan_flags.inc Wed Sep 11 18:35:09 2019
@@ -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_retu
 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.")

Modified: compiler-rt/trunk/lib/hwasan/hwasan_flags.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/hwasan/hwasan_flags.inc?rev=371702&r1=371701&r2=371702&view=diff
==============================================================================
--- compiler-rt/trunk/lib/hwasan/hwasan_flags.inc (original)
+++ compiler-rt/trunk/lib/hwasan/hwasan_flags.inc Wed Sep 11 18:35:09 2019
@@ -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.

Modified: compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh?rev=371702&r1=371701&r2=371702&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh (original)
+++ compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh Wed Sep 11 18:35:09 2019
@@ -124,21 +124,13 @@ run_lint ${SCUDO_RTL_LINT_FILTER} ${SCUD
                                   ${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




More information about the llvm-commits mailing list