tsan: qualify autos
authorDmitry Vyukov <dvyukov@google.com>
Thu, 5 Aug 2021 12:37:06 +0000 (14:37 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Thu, 5 Aug 2021 14:56:47 +0000 (16:56 +0200)
clang-tidy warning requires qualifying auto pointers:

clang-tidy: warning: 'auto ctx' can be declared as 'auto *ctx' [llvm-qualified-auto]

Fix remaing cases we have in tsan.

Depends on D107561.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D107562

compiler-rt/lib/tsan/go/tsan_go.cpp
compiler-rt/lib/tsan/rtl/tsan_rtl.cpp

index f139c22..fa8ad16 100644 (file)
@@ -99,7 +99,7 @@ ReportLocation *SymbolizeData(uptr addr) {
     MBlock *b = ctx->metamap.GetBlock(cbctx.start);
     if (!b)
       return 0;
-    auto loc = New<ReportLocation>();
+    auto *loc = New<ReportLocation>();
     loc->type = ReportLocationHeap;
     loc->heap_chunk_start = cbctx.start;
     loc->heap_chunk_size = b->siz;
@@ -107,7 +107,7 @@ ReportLocation *SymbolizeData(uptr addr) {
     loc->stack = SymbolizeStackId(b->stk);
     return loc;
   } else {
-    auto loc = New<ReportLocation>();
+    auto *loc = New<ReportLocation>();
     loc->type = ReportLocationGlobal;
     loc->global.name = internal_strdup(cbctx.name ? cbctx.name : "??");
     loc->global.file = internal_strdup(cbctx.file ? cbctx.file : "??");
@@ -140,7 +140,7 @@ Processor *ThreadState::proc() {
 extern "C" {
 
 static ThreadState *AllocGoroutine() {
-  auto thr = (ThreadState *)Alloc(sizeof(ThreadState));
+  auto *thr = (ThreadState *)Alloc(sizeof(ThreadState));
   internal_memset(thr, 0, sizeof(*thr));
   return thr;
 }
index 723fb30..080a106 100644 (file)
@@ -562,7 +562,7 @@ NOINLINE
 void GrowShadowStack(ThreadState *thr) {
   const int sz = thr->shadow_stack_end - thr->shadow_stack;
   const int newsz = 2 * sz;
-  auto newstack = (uptr *)Alloc(newsz * sizeof(uptr));
+  auto *newstack = (uptr *)Alloc(newsz * sizeof(uptr));
   internal_memcpy(newstack, thr->shadow_stack, sz * sizeof(uptr));
   Free(thr->shadow_stack);
   thr->shadow_stack = newstack;