Skip to content

Commit c0fa632

Browse files
committed
Remove NOLINTs from compiler-rt
llvm-svn: 371687
1 parent bcc24e4 commit c0fa632

File tree

92 files changed

+402
-398
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+402
-398
lines changed

compiler-rt/include/sanitizer/dfsan_interface.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,6 @@ void dfsan_weak_hook_strncmp(void *caller_pc, const char *s1, const char *s2,
111111
#ifdef __cplusplus
112112
} // extern "C"
113113

114-
template <typename T>
115-
void dfsan_set_label(dfsan_label label, T &data) { // NOLINT
116-
dfsan_set_label(label, (void *)&data, sizeof(T));
117-
}
118-
119114
#endif
120115

121116
#endif // DFSAN_INTERFACE_H

compiler-rt/include/sanitizer/tsan_interface_atomic.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
extern "C" {
1818
#endif
1919

20-
typedef char __tsan_atomic8;
21-
typedef short __tsan_atomic16; // NOLINT
22-
typedef int __tsan_atomic32;
23-
typedef long __tsan_atomic64; // NOLINT
20+
typedef char __tsan_atomic8;
21+
typedef short __tsan_atomic16;
22+
typedef int __tsan_atomic32;
23+
typedef long __tsan_atomic64;
2424
#if defined(__SIZEOF_INT128__) \
2525
|| (__clang_major__ * 100 + __clang_minor__ >= 302)
2626
__extension__ typedef __int128 __tsan_atomic128;

compiler-rt/lib/asan/asan_allocator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ IgnoreObjectResult IgnoreObjectLocked(const void *p) {
10751075
} // namespace __lsan
10761076

10771077
// ---------------------- Interface ---------------- {{{1
1078-
using namespace __asan; // NOLINT
1078+
using namespace __asan;
10791079

10801080
// ASan allocator doesn't reserve extra bytes, so normally we would
10811081
// just return "size". We don't want to expose our redzone sizes, etc here.

compiler-rt/lib/asan/asan_errors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ void ErrorInvalidPosixMemalignAlignment::Print() {
244244
"ERROR: AddressSanitizer: invalid alignment requested in posix_memalign: "
245245
"%zd, alignment must be a power of two and a multiple of sizeof(void*) "
246246
"== %zd (thread %s)\n",
247-
alignment, sizeof(void*), AsanThreadIdAndName(tid).c_str()); // NOLINT
247+
alignment, sizeof(void *), AsanThreadIdAndName(tid).c_str());
248248
Printf("%s", d.Default());
249249
stack->Print();
250250
PrintHintAllocatorCannotReturnNull();

compiler-rt/lib/asan/asan_globals.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,7 @@ static void RegisterGlobal(const Global *g) {
227227
list_of_all_globals = l;
228228
if (g->has_dynamic_init) {
229229
if (!dynamic_init_globals) {
230-
dynamic_init_globals =
231-
new (allocator_for_globals) VectorOfGlobals; // NOLINT
230+
dynamic_init_globals = new (allocator_for_globals) VectorOfGlobals;
232231
dynamic_init_globals->reserve(kDynamicInitGlobalsInitialCapacity);
233232
}
234233
DynInitGlobal dyn_global = { *g, false };
@@ -315,8 +314,7 @@ void PrintGlobalLocation(InternalScopedString *str, const __asan_global &g) {
315314
} // namespace __asan
316315

317316
// ---------------------- Interface ---------------- {{{1
318-
using namespace __asan; // NOLINT
319-
317+
using namespace __asan;
320318

321319
// Apply __asan_register_globals to all globals found in the same loaded
322320
// executable or shared library as `flag'. The flag tracks whether globals have
@@ -364,7 +362,7 @@ void __asan_register_globals(__asan_global *globals, uptr n) {
364362
BlockingMutexLock lock(&mu_for_globals);
365363
if (!global_registration_site_vector) {
366364
global_registration_site_vector =
367-
new (allocator_for_globals) GlobalRegistrationSiteVector; // NOLINT
365+
new (allocator_for_globals) GlobalRegistrationSiteVector;
368366
global_registration_site_vector->reserve(128);
369367
}
370368
GlobalRegistrationSite site = {stack_id, &globals[0], &globals[n - 1]};

compiler-rt/lib/asan/asan_globals_win.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
namespace __asan {
1717

18-
#pragma section(".ASAN$GA", read, write) // NOLINT
19-
#pragma section(".ASAN$GZ", read, write) // NOLINT
18+
#pragma section(".ASAN$GA", read, write)
19+
#pragma section(".ASAN$GZ", read, write)
2020
extern "C" __declspec(allocate(".ASAN$GA"))
2121
ALIGNED(sizeof(__asan_global)) __asan_global __asan_globals_start = {};
2222
extern "C" __declspec(allocate(".ASAN$GZ"))
@@ -49,8 +49,8 @@ static void unregister_dso_globals() {
4949
}
5050

5151
// Register globals
52-
#pragma section(".CRT$XCU", long, read) // NOLINT
53-
#pragma section(".CRT$XTX", long, read) // NOLINT
52+
#pragma section(".CRT$XCU", long, read)
53+
#pragma section(".CRT$XTX", long, read)
5454
extern "C" __declspec(allocate(".CRT$XCU"))
5555
void (*const __asan_dso_reg_hook)() = &register_dso_globals;
5656
extern "C" __declspec(allocate(".CRT$XTX"))

compiler-rt/lib/asan/asan_interceptors.cpp

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ int OnExit() {
7979
} // namespace __asan
8080

8181
// ---------------------- Wrappers ---------------- {{{1
82-
using namespace __asan; // NOLINT
82+
using namespace __asan;
8383

8484
DECLARE_REAL_AND_INTERCEPTOR(void *, malloc, uptr)
8585
DECLARE_REAL_AND_INTERCEPTOR(void, free, void *)
@@ -373,26 +373,26 @@ DEFINE_REAL(char*, index, const char *string, int c)
373373

374374
// For both strcat() and strncat() we need to check the validity of |to|
375375
// argument irrespective of the |from| length.
376-
INTERCEPTOR(char*, strcat, char *to, const char *from) { // NOLINT
377-
void *ctx;
378-
ASAN_INTERCEPTOR_ENTER(ctx, strcat); // NOLINT
379-
ENSURE_ASAN_INITED();
380-
if (flags()->replace_str) {
381-
uptr from_length = REAL(strlen)(from);
382-
ASAN_READ_RANGE(ctx, from, from_length + 1);
383-
uptr to_length = REAL(strlen)(to);
384-
ASAN_READ_STRING_OF_LEN(ctx, to, to_length, to_length);
385-
ASAN_WRITE_RANGE(ctx, to + to_length, from_length + 1);
386-
// If the copying actually happens, the |from| string should not overlap
387-
// with the resulting string starting at |to|, which has a length of
388-
// to_length + from_length + 1.
389-
if (from_length > 0) {
390-
CHECK_RANGES_OVERLAP("strcat", to, from_length + to_length + 1,
391-
from, from_length + 1);
376+
INTERCEPTOR(char *, strcat, char *to, const char *from) {
377+
void *ctx;
378+
ASAN_INTERCEPTOR_ENTER(ctx, strcat);
379+
ENSURE_ASAN_INITED();
380+
if (flags()->replace_str) {
381+
uptr from_length = REAL(strlen)(from);
382+
ASAN_READ_RANGE(ctx, from, from_length + 1);
383+
uptr to_length = REAL(strlen)(to);
384+
ASAN_READ_STRING_OF_LEN(ctx, to, to_length, to_length);
385+
ASAN_WRITE_RANGE(ctx, to + to_length, from_length + 1);
386+
// If the copying actually happens, the |from| string should not overlap
387+
// with the resulting string starting at |to|, which has a length of
388+
// to_length + from_length + 1.
389+
if (from_length > 0) {
390+
CHECK_RANGES_OVERLAP("strcat", to, from_length + to_length + 1, from,
391+
from_length + 1);
392+
}
392393
}
394+
return REAL(strcat)(to, from);
393395
}
394-
return REAL(strcat)(to, from); // NOLINT
395-
}
396396

397397
INTERCEPTOR(char*, strncat, char *to, const char *from, uptr size) {
398398
void *ctx;
@@ -413,16 +413,17 @@ INTERCEPTOR(char*, strncat, char *to, const char *from, uptr size) {
413413
return REAL(strncat)(to, from, size);
414414
}
415415

416-
INTERCEPTOR(char*, strcpy, char *to, const char *from) { // NOLINT
416+
INTERCEPTOR(char *, strcpy, char *to, const char *from) {
417417
void *ctx;
418-
ASAN_INTERCEPTOR_ENTER(ctx, strcpy); // NOLINT
418+
ASAN_INTERCEPTOR_ENTER(ctx, strcpy);
419419
#if SANITIZER_MAC
420-
if (UNLIKELY(!asan_inited)) return REAL(strcpy)(to, from); // NOLINT
420+
if (UNLIKELY(!asan_inited))
421+
return REAL(strcpy)(to, from);
421422
#endif
422423
// strcpy is called from malloc_default_purgeable_zone()
423424
// in __asan::ReplaceSystemAlloc() on Mac.
424425
if (asan_init_is_running) {
425-
return REAL(strcpy)(to, from); // NOLINT
426+
return REAL(strcpy)(to, from);
426427
}
427428
ENSURE_ASAN_INITED();
428429
if (flags()->replace_str) {
@@ -431,7 +432,7 @@ INTERCEPTOR(char*, strcpy, char *to, const char *from) { // NOLINT
431432
ASAN_READ_RANGE(ctx, from, from_size);
432433
ASAN_WRITE_RANGE(ctx, to, from_size);
433434
}
434-
return REAL(strcpy)(to, from); // NOLINT
435+
return REAL(strcpy)(to, from);
435436
}
436437

437438
INTERCEPTOR(char*, strdup, const char *s) {
@@ -479,16 +480,15 @@ INTERCEPTOR(char*, strncpy, char *to, const char *from, uptr size) {
479480
return REAL(strncpy)(to, from, size);
480481
}
481482

482-
INTERCEPTOR(long, strtol, const char *nptr, // NOLINT
483-
char **endptr, int base) {
483+
INTERCEPTOR(long, strtol, const char *nptr, char **endptr, int base) {
484484
void *ctx;
485485
ASAN_INTERCEPTOR_ENTER(ctx, strtol);
486486
ENSURE_ASAN_INITED();
487487
if (!flags()->replace_str) {
488488
return REAL(strtol)(nptr, endptr, base);
489489
}
490490
char *real_endptr;
491-
long result = REAL(strtol)(nptr, &real_endptr, base); // NOLINT
491+
long result = REAL(strtol)(nptr, &real_endptr, base);
492492
StrtolFixAndCheck(ctx, nptr, endptr, real_endptr, base);
493493
return result;
494494
}
@@ -514,7 +514,7 @@ INTERCEPTOR(int, atoi, const char *nptr) {
514514
return result;
515515
}
516516

517-
INTERCEPTOR(long, atol, const char *nptr) { // NOLINT
517+
INTERCEPTOR(long, atol, const char *nptr) {
518518
void *ctx;
519519
ASAN_INTERCEPTOR_ENTER(ctx, atol);
520520
#if SANITIZER_MAC
@@ -525,36 +525,35 @@ INTERCEPTOR(long, atol, const char *nptr) { // NOLINT
525525
return REAL(atol)(nptr);
526526
}
527527
char *real_endptr;
528-
long result = REAL(strtol)(nptr, &real_endptr, 10); // NOLINT
528+
long result = REAL(strtol)(nptr, &real_endptr, 10);
529529
FixRealStrtolEndptr(nptr, &real_endptr);
530530
ASAN_READ_STRING(ctx, nptr, (real_endptr - nptr) + 1);
531531
return result;
532532
}
533533

534534
#if ASAN_INTERCEPT_ATOLL_AND_STRTOLL
535-
INTERCEPTOR(long long, strtoll, const char *nptr, // NOLINT
536-
char **endptr, int base) {
535+
INTERCEPTOR(long long, strtoll, const char *nptr, char **endptr, int base) {
537536
void *ctx;
538537
ASAN_INTERCEPTOR_ENTER(ctx, strtoll);
539538
ENSURE_ASAN_INITED();
540539
if (!flags()->replace_str) {
541540
return REAL(strtoll)(nptr, endptr, base);
542541
}
543542
char *real_endptr;
544-
long long result = REAL(strtoll)(nptr, &real_endptr, base); // NOLINT
543+
long long result = REAL(strtoll)(nptr, &real_endptr, base);
545544
StrtolFixAndCheck(ctx, nptr, endptr, real_endptr, base);
546545
return result;
547546
}
548547

549-
INTERCEPTOR(long long, atoll, const char *nptr) { // NOLINT
548+
INTERCEPTOR(long long, atoll, const char *nptr) {
550549
void *ctx;
551550
ASAN_INTERCEPTOR_ENTER(ctx, atoll);
552551
ENSURE_ASAN_INITED();
553552
if (!flags()->replace_str) {
554553
return REAL(atoll)(nptr);
555554
}
556555
char *real_endptr;
557-
long long result = REAL(strtoll)(nptr, &real_endptr, 10); // NOLINT
556+
long long result = REAL(strtoll)(nptr, &real_endptr, 10);
558557
FixRealStrtolEndptr(nptr, &real_endptr);
559558
ASAN_READ_STRING(ctx, nptr, (real_endptr - nptr) + 1);
560559
return result;
@@ -594,8 +593,8 @@ void InitializeAsanInterceptors() {
594593
InitializeSignalInterceptors();
595594

596595
// Intercept str* functions.
597-
ASAN_INTERCEPT_FUNC(strcat); // NOLINT
598-
ASAN_INTERCEPT_FUNC(strcpy); // NOLINT
596+
ASAN_INTERCEPT_FUNC(strcat);
597+
ASAN_INTERCEPT_FUNC(strcpy);
599598
ASAN_INTERCEPT_FUNC(strncat);
600599
ASAN_INTERCEPT_FUNC(strncpy);
601600
ASAN_INTERCEPT_FUNC(strdup);

compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "asan_stack.h"
1717
#include "asan_suppressions.h"
1818

19-
using namespace __asan; // NOLINT
19+
using namespace __asan;
2020

2121
void *__asan_memcpy(void *to, const void *from, uptr size) {
2222
ASAN_MEMCPY_IMPL(nullptr, to, from, size);

compiler-rt/lib/asan/asan_mac.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void asan_dispatch_call_block_and_release(void *block) {
205205

206206
} // namespace __asan
207207

208-
using namespace __asan; // NOLINT
208+
using namespace __asan;
209209

210210
// Wrap |ctxt| and |func| into an asan_block_context_t.
211211
// The caller retains control of the allocated context.

compiler-rt/lib/asan/asan_malloc_linux.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "asan_stack.h"
2828

2929
// ---------------------- Replacement functions ---------------- {{{1
30-
using namespace __asan; // NOLINT
30+
using namespace __asan;
3131

3232
static uptr allocated_for_dlsym;
3333
static uptr last_dlsym_alloc_size_in_words;

compiler-rt/lib/asan/asan_malloc_win.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ size_t WINAPI HeapSize(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem);
5454
BOOL WINAPI HeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem);
5555
}
5656

57-
using namespace __asan; // NOLINT
57+
using namespace __asan;
5858

5959
// MT: Simply defining functions with the same signature in *.obj
6060
// files overrides the standard functions in the CRT.

compiler-rt/lib/asan/asan_new_delete.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ COMMENT_EXPORT("??_V@YAXPAX@Z") // operator delete[]
4848
#define CXX_OPERATOR_ATTRIBUTE INTERCEPTOR_ATTRIBUTE
4949
#endif
5050

51-
using namespace __asan; // NOLINT
51+
using namespace __asan;
5252

5353
// FreeBSD prior v9.2 have wrong definition of 'size_t'.
5454
// http://svnweb.freebsd.org/base?view=revision&revision=232261

compiler-rt/lib/asan/asan_poisoning.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void AsanPoisonOrUnpoisonIntraObjectRedzone(uptr ptr, uptr size, bool poison) {
9292
} // namespace __asan
9393

9494
// ---------------------- Interface ---------------- {{{1
95-
using namespace __asan; // NOLINT
95+
using namespace __asan;
9696

9797
// Current implementation of __asan_(un)poison_memory_region doesn't check
9898
// that user program (un)poisons the memory it owns. It poisons memory

compiler-rt/lib/asan/asan_report.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ void ReportGenericError(uptr pc, uptr bp, uptr sp, uptr addr, bool is_write,
472472
} // namespace __asan
473473

474474
// --------------------------- Interface --------------------- {{{1
475-
using namespace __asan; // NOLINT
475+
using namespace __asan;
476476

477477
void __asan_report_error(uptr pc, uptr bp, uptr sp, uptr addr, int is_write,
478478
uptr access_size, u32 exp) {

compiler-rt/lib/asan/asan_rtl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ void AsanInitFromRtl() {
542542
// (and thus normal initializers from .preinit_array or modules haven't run).
543543

544544
class AsanInitializer {
545-
public: // NOLINT
545+
public:
546546
AsanInitializer() {
547547
AsanInitFromRtl();
548548
}
@@ -554,7 +554,7 @@ static AsanInitializer asan_initializer;
554554
} // namespace __asan
555555

556556
// ---------------------- Interface ---------------- {{{1
557-
using namespace __asan; // NOLINT
557+
using namespace __asan;
558558

559559
void NOINLINE __asan_handle_no_return() {
560560
if (asan_init_is_running)

compiler-rt/lib/asan/asan_stats.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static void PrintAccumulatedStats() {
133133
} // namespace __asan
134134

135135
// ---------------------- Interface ---------------- {{{1
136-
using namespace __asan; // NOLINT
136+
using namespace __asan;
137137

138138
uptr __sanitizer_get_current_allocated_bytes() {
139139
AsanStats stats;

compiler-rt/lib/asan/asan_suppressions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ SANITIZER_INTERFACE_WEAK_DEF(const char *, __asan_default_suppressions, void) {
3636

3737
void InitializeSuppressions() {
3838
CHECK_EQ(nullptr, suppression_ctx);
39-
suppression_ctx = new (suppression_placeholder) // NOLINT
39+
suppression_ctx = new (suppression_placeholder)
4040
SuppressionContext(kSuppressionTypes, ARRAY_SIZE(kSuppressionTypes));
4141
suppression_ctx->ParseFromFile(flags()->suppressions);
4242
if (&__asan_default_suppressions)

compiler-rt/lib/asan/asan_thread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ void EnsureMainThreadIDIsCorrect() {
505505
} // namespace __lsan
506506

507507
// ---------------------- Interface ---------------- {{{1
508-
using namespace __asan; // NOLINT
508+
using namespace __asan;
509509

510510
extern "C" {
511511
SANITIZER_INTERFACE_ATTRIBUTE

0 commit comments

Comments
 (0)