summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-01-18 15:53:43 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-01-18 15:53:43 +0000
commitc8cde8d736593150b09b782b7e179c05502babd4 (patch)
treea1df16e5ba5e201765e044d5c39854abb91f6e9f
parentd4c212eb6048fdc3cbedc409537a9e70af89bf6f (diff)
downloadbcm5719-llvm-c8cde8d736593150b09b782b7e179c05502babd4.tar.gz
bcm5719-llvm-c8cde8d736593150b09b782b7e179c05502babd4.zip
[sanitizer] Enable cpplint for .inc files.
llvm-svn: 172825
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc12
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc2
-rwxr-xr-xcompiler-rt/lib/sanitizer_common/scripts/check_lint.sh12
3 files changed, 19 insertions, 7 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
index 172fe9d5202..8bc2e8b5c29 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -195,7 +195,7 @@ INTERCEPTOR(int, fscanf, void* stream, const char *format, ...) { // NOLINT
INTERCEPTOR(int, sscanf, const char *str, const char *format, ...) { // NOLINT
void* ctx;
- COMMON_INTERCEPTOR_ENTER(ctx, sscanf, str, format);
+ COMMON_INTERCEPTOR_ENTER(ctx, sscanf, str, format); // NOLINT
va_list ap;
va_start(ap, format);
int res = vsscanf(str, format, ap); // NOLINT
@@ -204,11 +204,11 @@ INTERCEPTOR(int, sscanf, const char *str, const char *format, ...) { // NOLINT
}
#define INIT_SCANF \
- INTERCEPT_FUNCTION(scanf); \
- INTERCEPT_FUNCTION(sscanf); \
- INTERCEPT_FUNCTION(fscanf); \
- INTERCEPT_FUNCTION(vscanf); \
- INTERCEPT_FUNCTION(vsscanf); \
+ INTERCEPT_FUNCTION(scanf); \
+ INTERCEPT_FUNCTION(sscanf); /* NOLINT */ \
+ INTERCEPT_FUNCTION(fscanf); \
+ INTERCEPT_FUNCTION(vscanf); \
+ INTERCEPT_FUNCTION(vsscanf); \
INTERCEPT_FUNCTION(vfscanf)
#else
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc
index e327cadc5bc..63d67a7115e 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc
@@ -103,7 +103,7 @@ static void scanf_common(void *ctx, const char *format, va_list ap_const) {
++p;
continue;
}
-
+
if (*p == 'L' || *p == 'q') {
++p;
size = match_spec(scanf_llspecs, scanf_llspecs_cnt, *p);
diff --git a/compiler-rt/lib/sanitizer_common/scripts/check_lint.sh b/compiler-rt/lib/sanitizer_common/scripts/check_lint.sh
index 2357f6ca341..bbeaaf80936 100755
--- a/compiler-rt/lib/sanitizer_common/scripts/check_lint.sh
+++ b/compiler-rt/lib/sanitizer_common/scripts/check_lint.sh
@@ -26,6 +26,7 @@ TSAN_RTL_LINT_FILTER=-legal/copyright,-build/include,-readability/casting,-build
TSAN_TEST_LINT_FILTER=${TSAN_RTL_LINT_FILTER},-runtime/threadsafe_fn,-runtime/int
TSAN_LIT_TEST_LINT_FILTER=${TSAN_TEST_LINT_FILTER},-whitespace/line_length
MSAN_RTL_LINT_FILTER=-legal/copyright,-build/include,-readability/casting,-build/header_guard,-build/namespaces
+TSAN_RTL_INC_LINT_FILTER=${TSAN_TEST_LINT_FILTER},-runtime/sizeof
cd ${LLVM_CHECKOUT}
@@ -63,6 +64,17 @@ ${CPPLINT} --filter=${TSAN_RTL_LINT_FILTER} ${TSAN_RTL}/rtl/*.{cc,h}
${CPPLINT} --filter=${TSAN_TEST_LINT_FILTER} ${TSAN_RTL}/tests/rtl/*.{cc,h} \
${TSAN_RTL}/tests/unit/*.cc
${CPPLINT} --filter=${TSAN_LIT_TEST_LINT_FILTER} ${TSAN_RTL}/lit_tests/*.cc
+
# MSan
MSAN_RTL=${COMPILER_RT}/lib/msan
${CPPLINT} --filter=${MSAN_RTL_LINT_FILTER} ${MSAN_RTL}/*.{cc,h}
+
+# Misc files
+FILES=${COMMON_RTL}/*.inc
+for FILE in $FILES; do
+ TMPFILE=$(mktemp --tmpdir $(basename $FILE)_XXXXX.cc)
+ echo "Checking $FILE"
+ cp -f $FILE $TMPFILE
+ ${CPPLINT} --filter=${TSAN_RTL_INC_LINT_FILTER} $TMPFILE
+ rm $TMPFILE
+done
OpenPOWER on IntegriCloud