[PATCH] D62489: [HWASAN] Remove unused(?) code

Eugene Leviant via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 27 09:50:10 PDT 2019


evgeny777 created this revision.
evgeny777 added reviewers: vitalybuka, eugenis, kcc.
Herald added a subscriber: kubamracek.

It looks like `in_interceptor_scope` flag is not used anywhere. If it is, I wonder what's the purpose of it?


https://reviews.llvm.org/D62489

Files:
  lib/hwasan/hwasan_interceptors.cpp
  lib/hwasan/hwasan_thread.h


Index: lib/hwasan/hwasan_thread.h
===================================================================
--- lib/hwasan/hwasan_thread.h
+++ lib/hwasan/hwasan_thread.h
@@ -46,10 +46,6 @@
   void EnterSymbolizer() { in_symbolizer_++; }
   void LeaveSymbolizer() { in_symbolizer_--; }
 
-  bool InInterceptorScope() { return in_interceptor_scope_; }
-  void EnterInterceptorScope() { in_interceptor_scope_++; }
-  void LeaveInterceptorScope() { in_interceptor_scope_--; }
-
   AllocatorCache *allocator_cache() { return &allocator_cache_; }
   HeapAllocationsRingBuffer *heap_allocations() { return heap_allocations_; }
   StackAllocationsRingBuffer *stack_allocations() { return stack_allocations_; }
@@ -82,7 +78,6 @@
 
   unsigned in_signal_handler_;
   unsigned in_symbolizer_;
-  unsigned in_interceptor_scope_;
 
   u32 random_state_;
   u32 random_buffer_;
Index: lib/hwasan/hwasan_interceptors.cpp
===================================================================
--- lib/hwasan/hwasan_interceptors.cpp
+++ lib/hwasan/hwasan_interceptors.cpp
@@ -44,24 +44,6 @@
 using __sanitizer::atomic_store;
 using __sanitizer::atomic_uintptr_t;
 
-bool IsInInterceptorScope() {
-  Thread *t = GetCurrentThread();
-  return t && t->InInterceptorScope();
-}
-
-struct InterceptorScope {
-  InterceptorScope() {
-    Thread *t = GetCurrentThread();
-    if (t)
-      t->EnterInterceptorScope();
-  }
-  ~InterceptorScope() {
-    Thread *t = GetCurrentThread();
-    if (t)
-      t->LeaveInterceptorScope();
-  }
-};
-
 static uptr allocated_for_dlsym;
 static const uptr kDlsymAllocPoolSize = 1024;
 static uptr alloc_memory_for_dlsym[kDlsymAllocPoolSize];
@@ -254,11 +236,6 @@
   return pid;
 }
 
-
-struct HwasanInterceptorContext {
-  bool in_interceptor_scope;
-};
-
 namespace __hwasan {
 
 int OnExit() {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62489.201542.patch
Type: text/x-patch
Size: 1803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190527/14550869/attachment.bin>


More information about the llvm-commits mailing list