[compiler-rt] 44c83ec - [sanitizer] Remove cpplint annotations
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 30 18:21:04 PDT 2021
Author: Vitaly Buka
Date: 2021-07-30T18:20:40-07:00
New Revision: 44c83eccf9ef8bb127a2fa4e9da7f21d732b5829
URL: https://github.com/llvm/llvm-project/commit/44c83eccf9ef8bb127a2fa4e9da7f21d732b5829
DIFF: https://github.com/llvm/llvm-project/commit/44c83eccf9ef8bb127a2fa4e9da7f21d732b5829.diff
LOG: [sanitizer] Remove cpplint annotations
cpplint was removed by D107197
Differential Revision: https://reviews.llvm.org/D107198
Added:
Modified:
compiler-rt/include/sanitizer/dfsan_interface.h
compiler-rt/lib/dfsan/dfsan.h
compiler-rt/lib/dfsan/dfsan_custom.cpp
compiler-rt/lib/dfsan/dfsan_interceptors.cpp
compiler-rt/lib/msan/msan_interceptors.cpp
compiler-rt/lib/msan/tests/msan_test.cpp
compiler-rt/lib/sanitizer_common/sanitizer_asm.h
compiler-rt/lib/sanitizer_common/sanitizer_common.h
compiler-rt/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
compiler-rt/lib/sanitizer_common/tests/sanitizer_printf_test.cpp
compiler-rt/lib/tsan/rtl/tsan_interface.h
compiler-rt/test/asan/TestCases/vla_condition_overflow.cpp
compiler-rt/test/lsan/TestCases/use_globals_unused.cpp
compiler-rt/utils/generate_netbsd_ioctls.awk
Removed:
################################################################################
diff --git a/compiler-rt/include/sanitizer/dfsan_interface.h b/compiler-rt/include/sanitizer/dfsan_interface.h
index cd3b6d6e2b16..d6209a3ea2b2 100644
--- a/compiler-rt/include/sanitizer/dfsan_interface.h
+++ b/compiler-rt/include/sanitizer/dfsan_interface.h
@@ -150,8 +150,7 @@ int dfsan_get_track_origins(void);
#ifdef __cplusplus
} // extern "C"
-template <typename T>
-void dfsan_set_label(dfsan_label label, T &data) { // NOLINT
+template <typename T> void dfsan_set_label(dfsan_label label, T &data) {
dfsan_set_label(label, (void *)&data, sizeof(T));
}
diff --git a/compiler-rt/lib/dfsan/dfsan.h b/compiler-rt/lib/dfsan/dfsan.h
index b212298157eb..b529e008f300 100644
--- a/compiler-rt/lib/dfsan/dfsan.h
+++ b/compiler-rt/lib/dfsan/dfsan.h
@@ -49,7 +49,7 @@ void dfsan_mem_origin_transfer(const void *dst, const void *src, uptr len);
} // extern "C"
template <typename T>
-void dfsan_set_label(dfsan_label label, T &data) { // NOLINT
+void dfsan_set_label(dfsan_label label, T &data) {
dfsan_set_label(label, (void *)&data, sizeof(T));
}
diff --git a/compiler-rt/lib/dfsan/dfsan_custom.cpp b/compiler-rt/lib/dfsan/dfsan_custom.cpp
index 3185184f29c8..01cacfad9ce5 100644
--- a/compiler-rt/lib/dfsan/dfsan_custom.cpp
+++ b/compiler-rt/lib/dfsan/dfsan_custom.cpp
@@ -583,7 +583,7 @@ SANITIZER_INTERFACE_ATTRIBUTE char *__dfsw_strcat(char *dest, const char *src,
dfsan_label src_label,
dfsan_label *ret_label) {
size_t dest_len = strlen(dest);
- char *ret = strcat(dest, src); // NOLINT
+ char *ret = strcat(dest, src);
dfsan_label *sdest = shadow_for(dest + dest_len);
const dfsan_label *ssrc = shadow_for(src);
internal_memcpy((void *)sdest, (const void *)ssrc,
@@ -597,7 +597,7 @@ SANITIZER_INTERFACE_ATTRIBUTE char *__dfso_strcat(
dfsan_label *ret_label, dfsan_origin dest_origin, dfsan_origin src_origin,
dfsan_origin *ret_origin) {
size_t dest_len = strlen(dest);
- char *ret = strcat(dest, src); // NOLINT
+ char *ret = strcat(dest, src);
dfsan_label *sdest = shadow_for(dest + dest_len);
const dfsan_label *ssrc = shadow_for(src);
size_t src_len = strlen(src);
@@ -1088,7 +1088,7 @@ int __dfso_getrusage(int who, struct rusage *usage, dfsan_label who_label,
SANITIZER_INTERFACE_ATTRIBUTE
char *__dfsw_strcpy(char *dest, const char *src, dfsan_label dst_label,
dfsan_label src_label, dfsan_label *ret_label) {
- char *ret = strcpy(dest, src); // NOLINT
+ char *ret = strcpy(dest, src);
if (ret) {
internal_memcpy(shadow_for(dest), shadow_for(src),
sizeof(dfsan_label) * (strlen(src) + 1));
@@ -1102,7 +1102,7 @@ char *__dfso_strcpy(char *dest, const char *src, dfsan_label dst_label,
dfsan_label src_label, dfsan_label *ret_label,
dfsan_origin dst_origin, dfsan_origin src_origin,
dfsan_origin *ret_origin) {
- char *ret = strcpy(dest, src); // NOLINT
+ char *ret = strcpy(dest, src);
if (ret) {
size_t str_len = strlen(src) + 1;
dfsan_mem_origin_transfer(dest, src, str_len);
diff --git a/compiler-rt/lib/dfsan/dfsan_interceptors.cpp b/compiler-rt/lib/dfsan/dfsan_interceptors.cpp
index 92be4fc87d49..6e3228c326f1 100644
--- a/compiler-rt/lib/dfsan/dfsan_interceptors.cpp
+++ b/compiler-rt/lib/dfsan/dfsan_interceptors.cpp
@@ -152,7 +152,7 @@ INTERCEPTOR(uptr, malloc_usable_size, void *ptr) {
if (__dfsan::dfsan_init_is_running) \
return REAL(func)(__VA_ARGS__); \
ENSURE_DFSAN_INITED(); \
- dfsan_set_label(0, __errno_location(), sizeof(int)); /* NOLINT */
+ dfsan_set_label(0, __errno_location(), sizeof(int));
INTERCEPTOR(void *, mmap, void *addr, SIZE_T length, int prot, int flags,
int fd, OFF_T offset) {
diff --git a/compiler-rt/lib/msan/msan_interceptors.cpp b/compiler-rt/lib/msan/msan_interceptors.cpp
index 646cb1e96b35..b26cae1dfbcd 100644
--- a/compiler-rt/lib/msan/msan_interceptors.cpp
+++ b/compiler-rt/lib/msan/msan_interceptors.cpp
@@ -1278,14 +1278,15 @@ int OnExit() {
CHECK_UNPOISONED_CTX(ctx, ptr, size)
#define COMMON_INTERCEPTOR_INITIALIZE_RANGE(ptr, size) \
__msan_unpoison(ptr, size)
-#define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) \
- if (msan_init_is_running) return REAL(func)(__VA_ARGS__); \
- ENSURE_MSAN_INITED(); \
- MSanInterceptorContext msan_ctx = {IsInInterceptorScope()}; \
- ctx = (void *)&msan_ctx; \
- (void)ctx; \
- InterceptorScope interceptor_scope; \
- __msan_unpoison(__errno_location(), sizeof(int)); /* NOLINT */
+#define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) \
+ if (msan_init_is_running) \
+ return REAL(func)(__VA_ARGS__); \
+ ENSURE_MSAN_INITED(); \
+ MSanInterceptorContext msan_ctx = {IsInInterceptorScope()}; \
+ ctx = (void *)&msan_ctx; \
+ (void)ctx; \
+ InterceptorScope interceptor_scope; \
+ __msan_unpoison(__errno_location(), sizeof(int));
#define COMMON_INTERCEPTOR_DIR_ACQUIRE(ctx, path) \
do { \
} while (false)
diff --git a/compiler-rt/lib/msan/tests/msan_test.cpp b/compiler-rt/lib/msan/tests/msan_test.cpp
index 314f8874ecf8..d10291e36239 100644
--- a/compiler-rt/lib/msan/tests/msan_test.cpp
+++ b/compiler-rt/lib/msan/tests/msan_test.cpp
@@ -4318,8 +4318,8 @@ TEST(MemorySanitizerOrigins, InitializedStoreDoesNotChangeOrigin) {
template<class T, class BinaryOp>
ALWAYS_INLINE
void BinaryOpOriginTest(BinaryOp op) {
- U4 ox = rand(); //NOLINT
- U4 oy = rand(); //NOLINT
+ U4 ox = rand();
+ U4 oy = rand();
T *x = GetPoisonedO<T>(0, ox, 0);
T *y = GetPoisonedO<T>(1, oy, 0);
T *z = GetPoisonedO<T>(2, 0, 0);
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_asm.h b/compiler-rt/lib/sanitizer_common/sanitizer_asm.h
index 803af3285e18..81c10c53239a 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_asm.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_asm.h
@@ -61,7 +61,7 @@
#if defined(__ELF__) && (defined(__GNU__) || defined(__FreeBSD__) || \
defined(__Fuchsia__) || defined(__linux__))
// clang-format off
-#define NO_EXEC_STACK_DIRECTIVE .section .note.GNU-stack,"",%progbits // NOLINT
+#define NO_EXEC_STACK_DIRECTIVE .section .note.GNU-stack,"",%progbits
// clang-format on
#else
#define NO_EXEC_STACK_DIRECTIVE
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common.h b/compiler-rt/lib/sanitizer_common/sanitizer_common.h
index cbdbb0c4c4bd..c214f6f72cc6 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common.h
@@ -1073,7 +1073,7 @@ class ArrayRef {
} // namespace __sanitizer
inline void *operator new(__sanitizer::operator_new_size_type size,
- __sanitizer::LowLevelAllocator &alloc) { // NOLINT
+ __sanitizer::LowLevelAllocator &alloc) {
return alloc.Allocate(size);
}
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc b/compiler-rt/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
index 576807ea3a6a..9683b97ab91d 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
@@ -1406,7 +1406,7 @@ static void ioctl_table_fill() {
_(URIO_SEND_COMMAND, READWRITE, struct_urio_command_sz);
_(URIO_RECV_COMMAND, READWRITE, struct_urio_command_sz);
#undef _
-} // NOLINT
+}
static bool ioctl_initialized = false;
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
index 5b710c23fd00..fabeabf8f00b 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -309,7 +309,7 @@
#define SANITIZER_INTERCEPT_PPOLL SI_LINUX_NOT_ANDROID || SI_SOLARIS
#define SANITIZER_INTERCEPT_WORDEXP \
(SI_FREEBSD || SI_NETBSD || (SI_MAC && !SI_IOS) || SI_LINUX_NOT_ANDROID || \
- SI_SOLARIS) // NOLINT
+ SI_SOLARIS)
#define SANITIZER_INTERCEPT_SIGWAIT SI_POSIX
#define SANITIZER_INTERCEPT_SIGWAITINFO SI_LINUX_NOT_ANDROID || SI_SOLARIS
#define SANITIZER_INTERCEPT_SIGTIMEDWAIT SI_LINUX_NOT_ANDROID || SI_SOLARIS
@@ -337,7 +337,7 @@
#define SANITIZER_INTERCEPT_ETHER_R (SI_FREEBSD || SI_LINUX_NOT_ANDROID)
#define SANITIZER_INTERCEPT_SHMCTL \
(((SI_FREEBSD || SI_LINUX_NOT_ANDROID) && SANITIZER_WORDSIZE == 64) || \
- SI_NETBSD || SI_SOLARIS) // NOLINT
+ SI_NETBSD || SI_SOLARIS)
#define SANITIZER_INTERCEPT_RANDOM_R SI_GLIBC
#define SANITIZER_INTERCEPT_PTHREAD_ATTR_GET SI_POSIX
#define SANITIZER_INTERCEPT_PTHREAD_ATTR_GETINHERITSCHED \
diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_printf_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_printf_test.cpp
index 7a3724c3ab39..713f7e15976c 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_printf_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_printf_test.cpp
@@ -37,7 +37,7 @@ TEST(Printf, Basic) {
TEST(Printf, OverflowStr) {
char buf[] = "123456789";
- uptr len = internal_snprintf(buf, 4, "%s", "abcdef"); // NOLINT
+ uptr len = internal_snprintf(buf, 4, "%s", "abcdef");
EXPECT_EQ(len, (uptr)6);
EXPECT_STREQ("abc", buf);
EXPECT_EQ(buf[3], 0);
@@ -51,7 +51,7 @@ TEST(Printf, OverflowStr) {
TEST(Printf, OverflowInt) {
char buf[] = "123456789";
- internal_snprintf(buf, 4, "%d", -123456789); // NOLINT
+ internal_snprintf(buf, 4, "%d", -123456789);
EXPECT_STREQ("-12", buf);
EXPECT_EQ(buf[3], 0);
EXPECT_EQ(buf[4], '5');
@@ -70,7 +70,7 @@ TEST(Printf, OverflowUint) {
} else {
val = (uptr)0x123456789ULL;
}
- internal_snprintf(buf, 4, "a%zx", val); // NOLINT
+ internal_snprintf(buf, 4, "a%zx", val);
EXPECT_STREQ("a12", buf);
EXPECT_EQ(buf[3], 0);
EXPECT_EQ(buf[4], '5');
@@ -89,7 +89,7 @@ TEST(Printf, OverflowPtr) {
} else {
p = (void*)0x123456789ULL;
}
- internal_snprintf(buf, 4, "%p", p); // NOLINT
+ internal_snprintf(buf, 4, "%p", p);
EXPECT_STREQ("0x0", buf);
EXPECT_EQ(buf[3], 0);
EXPECT_EQ(buf[4], '5');
@@ -153,7 +153,7 @@ TEST(Printf, Precision) {
EXPECT_STREQ("12345 ", buf);
// Check that width does not overflow the smaller buffer, although
// 10 chars is requested, it stops at the buffer size, 8.
- len = internal_snprintf(buf, 8, "%-10s", "12345"); // NOLINT
+ len = internal_snprintf(buf, 8, "%-10s", "12345");
EXPECT_EQ(10U, len); // The required size reported.
EXPECT_STREQ("12345 ", buf);
}
diff --git a/compiler-rt/lib/tsan/rtl/tsan_interface.h b/compiler-rt/lib/tsan/rtl/tsan_interface.h
index 124aa2fd2143..482da73510ef 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_interface.h
+++ b/compiler-rt/lib/tsan/rtl/tsan_interface.h
@@ -95,9 +95,9 @@ SANITIZER_INTERFACE_ATTRIBUTE
void __tsan_write_range(void *addr, unsigned long size);
SANITIZER_INTERFACE_ATTRIBUTE
-void __tsan_read_range_pc(void *addr, unsigned long size, void *pc); // NOLINT
+void __tsan_read_range_pc(void *addr, unsigned long size, void *pc);
SANITIZER_INTERFACE_ATTRIBUTE
-void __tsan_write_range_pc(void *addr, unsigned long size, void *pc); // NOLINT
+void __tsan_write_range_pc(void *addr, unsigned long size, void *pc);
// User may provide function that would be called right when TSan detects
// an error. The argument 'report' is an opaque pointer that can be used to
diff --git a/compiler-rt/test/asan/TestCases/vla_condition_overflow.cpp b/compiler-rt/test/asan/TestCases/vla_condition_overflow.cpp
index cf42d794e9d5..00df5d2919c4 100644
--- a/compiler-rt/test/asan/TestCases/vla_condition_overflow.cpp
+++ b/compiler-rt/test/asan/TestCases/vla_condition_overflow.cpp
@@ -8,7 +8,7 @@
__attribute__((noinline)) void foo(int index, int len) {
if (index > len) {
- char str[len]; //NOLINT
+ char str[len];
assert(!(reinterpret_cast<uintptr_t>(str) & 31L));
str[index] = '1'; // BOOM
// CHECK: ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
diff --git a/compiler-rt/test/lsan/TestCases/use_globals_unused.cpp b/compiler-rt/test/lsan/TestCases/use_globals_unused.cpp
index e114620ad6ce..4a93d14c5f76 100644
--- a/compiler-rt/test/lsan/TestCases/use_globals_unused.cpp
+++ b/compiler-rt/test/lsan/TestCases/use_globals_unused.cpp
@@ -15,7 +15,7 @@
#ifdef TEST_LIB
void set(char *a) {
- strcpy(a, "hello"); // NOLINT
+ strcpy(a, "hello");
}
#else
diff --git a/compiler-rt/utils/generate_netbsd_ioctls.awk b/compiler-rt/utils/generate_netbsd_ioctls.awk
index 29840c99068f..0e122267b4ae 100755
--- a/compiler-rt/utils/generate_netbsd_ioctls.awk
+++ b/compiler-rt/utils/generate_netbsd_ioctls.awk
@@ -337,7 +337,7 @@ END {
}
pcmd("#undef _")
- pcmd("} // NOLINT")
+ pcmd("}")
pcmd("")
pcmd("static bool ioctl_initialized = false;")
pcmd("")
More information about the llvm-commits
mailing list