[compiler-rt] r317699 - [sanitizer] Add Scudo to the sanitizer lint checks.
Kostya Kortchinsky via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 8 08:42:30 PST 2017
Author: cryptoad
Date: Wed Nov 8 08:42:29 2017
New Revision: 317699
URL: http://llvm.org/viewvc/llvm-project?rev=317699&view=rev
Log:
[sanitizer] Add Scudo to the sanitizer lint checks.
Summary:
Scudo abides by the coding style enforced by the sanitizer_common
linter, but as of right now, it's not linter-enforced.
Add Scudo to the list of directories checked by check_lint.sh.
Also: fixes some linter errors found after getting this running.
Reviewers: cryptoad
Reviewed By: cryptoad
Subscribers: llvm-commits, kubamracek
Differential Revision: https://reviews.llvm.org/D39757
Modified:
compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh
compiler-rt/trunk/lib/scudo/scudo_allocator_secondary.h
compiler-rt/trunk/lib/scudo/scudo_crc32.h
compiler-rt/trunk/lib/scudo/scudo_utils.cpp
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=317699&r1=317698&r2=317699&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh (original)
+++ compiler-rt/trunk/lib/sanitizer_common/scripts/check_lint.sh Wed Nov 8 08:42:29 2017
@@ -29,6 +29,7 @@ MSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTE
LSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER}
LSAN_LIT_TEST_LINT_FILTER=${LSAN_RTL_LINT_FILTER},-whitespace/line_length
DFSAN_RTL_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/int,-runtime/printf,-runtime/references,-readability/function
+SCUDO_RTL_LINT_FILTER=${COMMON_LINT_FILTER}
COMMON_RTL_INC_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/int,-runtime/sizeof,-runtime/printf,-readability/fn_size
SANITIZER_INCLUDES_LINT_FILTER=${COMMON_LINT_FILTER},-runtime/int
@@ -112,6 +113,11 @@ run_lint ${DFSAN_RTL_LINT_FILTER} ${DFSA
${DFSAN_RTL}/*.h &
${DFSAN_RTL}/scripts/check_custom_wrappers.sh >> $ERROR_LOG
+# Scudo
+SCUDO_RTL=${COMPILER_RT}/lib/scudo
+run_lint ${SCUDO_RTL_LINT_FILTER} ${SCUDO_RTL}/*.cpp \
+ ${SCUDO_RTL}/*.h &
+
# Misc files
FILES=${COMMON_RTL}/*.inc
TMPFILES=""
Modified: compiler-rt/trunk/lib/scudo/scudo_allocator_secondary.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/scudo/scudo_allocator_secondary.h?rev=317699&r1=317698&r2=317699&view=diff
==============================================================================
--- compiler-rt/trunk/lib/scudo/scudo_allocator_secondary.h (original)
+++ compiler-rt/trunk/lib/scudo/scudo_allocator_secondary.h Wed Nov 8 08:42:29 2017
@@ -23,7 +23,6 @@
class ScudoLargeMmapAllocator {
public:
-
void Init() {
PageSize = GetPageSizeCached();
}
Modified: compiler-rt/trunk/lib/scudo/scudo_crc32.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/scudo/scudo_crc32.h?rev=317699&r1=317698&r2=317699&view=diff
==============================================================================
--- compiler-rt/trunk/lib/scudo/scudo_crc32.h (original)
+++ compiler-rt/trunk/lib/scudo/scudo_crc32.h Wed Nov 8 08:42:29 2017
@@ -40,7 +40,7 @@ enum : u8 {
CRC32Hardware = 1,
};
-const static u32 CRC32Table[] = {
+static const u32 CRC32Table[] = {
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2,
Modified: compiler-rt/trunk/lib/scudo/scudo_utils.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/scudo/scudo_utils.cpp?rev=317699&r1=317698&r2=317699&view=diff
==============================================================================
--- compiler-rt/trunk/lib/scudo/scudo_utils.cpp (original)
+++ compiler-rt/trunk/lib/scudo/scudo_utils.cpp Wed Nov 8 08:42:29 2017
@@ -90,8 +90,7 @@ typedef struct {
u32 Edx;
} CPUIDRegs;
-static void getCPUID(CPUIDRegs *Regs, u32 Level)
-{
+static void getCPUID(CPUIDRegs *Regs, u32 Level) {
__get_cpuid(Level, &Regs->Eax, &Regs->Ebx, &Regs->Ecx, &Regs->Edx);
}
@@ -118,8 +117,7 @@ CPUIDRegs getCPUFeatures() {
# define bit_SSE4_2 bit_SSE42 // clang and gcc have different defines.
# endif
-bool testCPUFeature(CPUFeature Feature)
-{
+bool testCPUFeature(CPUFeature Feature) {
CPUIDRegs FeaturesRegs = getCPUFeatures();
switch (Feature) {
More information about the llvm-commits
mailing list