From cf5c53727bd47b4f66ea5e37039cb9a25d28b7c2 Mon Sep 17 00:00:00 2001 From: Snehasish Kumar Date: Wed, 23 Nov 2022 19:00:03 +0000 Subject: [PATCH] [memprof] Fix RAII usage of SpinMutexLock, remove unused headers. For the RAII lock usage we need to create a local var. There were some headers which clang-tidy identified as unused. Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D138593 --- compiler-rt/lib/memprof/memprof_allocator.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/compiler-rt/lib/memprof/memprof_allocator.cpp b/compiler-rt/lib/memprof/memprof_allocator.cpp index 6f8c613..4bd3746 100644 --- a/compiler-rt/lib/memprof/memprof_allocator.cpp +++ b/compiler-rt/lib/memprof/memprof_allocator.cpp @@ -28,10 +28,8 @@ #include "sanitizer_common/sanitizer_flags.h" #include "sanitizer_common/sanitizer_interface_internal.h" #include "sanitizer_common/sanitizer_internal_defs.h" -#include "sanitizer_common/sanitizer_list.h" #include "sanitizer_common/sanitizer_procmaps.h" #include "sanitizer_common/sanitizer_stackdepot.h" -#include "sanitizer_common/sanitizer_vector.h" #include #include @@ -279,7 +277,7 @@ struct Allocator { static void PrintCallback(const uptr Key, LockedMemInfoBlock *const &Value, void *Arg) { - SpinMutexLock(&Value->mutex); + SpinMutexLock l(&Value->mutex); Print(Value->mib, Key, bool(Arg)); } -- 2.7.4