[compiler-rt] c6a485c - tsan: qualify autos

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 5 07:56:51 PDT 2021


Author: Dmitry Vyukov
Date: 2021-08-05T16:56:47+02:00
New Revision: c6a485caf69326d2fd3300a4f8944889bdd189cd

URL: https://github.com/llvm/llvm-project/commit/c6a485caf69326d2fd3300a4f8944889bdd189cd
DIFF: https://github.com/llvm/llvm-project/commit/c6a485caf69326d2fd3300a4f8944889bdd189cd.diff

LOG: tsan: qualify autos

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/tsan/go/tsan_go.cpp b/compiler-rt/lib/tsan/go/tsan_go.cpp
index f139c226d9b8e..fa8ad16bcd928 100644
--- a/compiler-rt/lib/tsan/go/tsan_go.cpp
+++ b/compiler-rt/lib/tsan/go/tsan_go.cpp
@@ -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;
 }

diff  --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp b/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp
index 723fb30c95c8b..080a106f14f8b 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.cpp
@@ -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;


        


More information about the llvm-commits mailing list