[compiler-rt] r189479 - Make lint checker script more robust

Alexey Samsonov samsonov at google.com
Wed Aug 28 05:15:03 PDT 2013


Author: samsonov
Date: Wed Aug 28 07:15:03 2013
New Revision: 189479

URL: http://llvm.org/viewvc/llvm-project?rev=189479&view=rev
Log:
Make lint checker script more robust

Modified:
    compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt
    compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh

Modified: compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt?rev=189479&r1=189478&r2=189479&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt Wed Aug 28 07:15:03 2013
@@ -104,7 +104,8 @@ endif()
 if(UNIX)
   set(SANITIZER_LINT_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/scripts/check_lint.sh)
   add_custom_target(SanitizerLintCheck ALL
-    COMMAND LLVM_CHECKOUT=${LLVM_MAIN_SRC_DIR} SILENT=1 ${SANITIZER_LINT_SCRIPT}
+    COMMAND LLVM_CHECKOUT=${LLVM_MAIN_SRC_DIR} SILENT=1 TMPDIR=
+      ${SANITIZER_LINT_SCRIPT}
     DEPENDS ${SANITIZER_LINT_SCRIPT}
     COMMENT "Running lint check for sanitizer sources..."
     VERBATIM)

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=189479&r1=189478&r2=189479&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh (original)
+++ compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh Wed Aug 28 07:15:03 2013
@@ -31,12 +31,12 @@ SANITIZER_INCLUDES_LINT_FILTER=${COMMON_
 cd ${LLVM_CHECKOUT}
 
 EXITSTATUS=0
-LOG=$(mktemp)
+LOG=$(mktemp -q)
 
 run_lint() {
   FILTER=$1
   shift
-  if [ "${SILENT}" == "1" ]; then
+  if [[ "${SILENT}" == "1" && "${LOG}" != "" ]]; then
     ${CPPLINT} --filter=${FILTER} "$@" 2>>$LOG
   else
     ${CPPLINT} --filter=${FILTER} "$@"
@@ -97,7 +97,8 @@ for FILE in $FILES; do
 done
 
 if [ "$EXITSTATUS" != "0" ]; then
-  cat $LOG | grep -v "Done processing" | grep -v "Total errors found"
+  cat $LOG | grep -v "Done processing" | grep -v "Total errors found" \
+    grep -v "Skipping input"
 fi
 
 exit $EXITSTATUS





More information about the llvm-commits mailing list