[compiler-rt] r346452 - [hwasan] Remove dead code.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 8 16:03:40 PST 2018


Author: eugenis
Date: Thu Nov  8 16:03:39 2018
New Revision: 346452

URL: http://llvm.org/viewvc/llvm-project?rev=346452&view=rev
Log:
[hwasan] Remove dead code.

Modified:
    compiler-rt/trunk/lib/hwasan/hwasan.cc
    compiler-rt/trunk/lib/hwasan/hwasan.h
    compiler-rt/trunk/lib/hwasan/hwasan_interceptors.cc
    compiler-rt/trunk/lib/hwasan/hwasan_report.cc
    compiler-rt/trunk/lib/hwasan/hwasan_report.h

Modified: compiler-rt/trunk/lib/hwasan/hwasan.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/hwasan/hwasan.cc?rev=346452&r1=346451&r2=346452&view=diff
==============================================================================
--- compiler-rt/trunk/lib/hwasan/hwasan.cc (original)
+++ compiler-rt/trunk/lib/hwasan/hwasan.cc Thu Nov  8 16:03:39 2018
@@ -159,11 +159,6 @@ void GetStackTrace(BufferedStackTrace *s
                 request_fast_unwind);
 }
 
-void PrintWarning(uptr pc, uptr bp) {
-  GET_FATAL_STACK_TRACE_PC_BP(pc, bp);
-  ReportInvalidAccess(&stack, 0);
-}
-
 static void HWAsanCheckFailed(const char *file, int line, const char *cond,
                               u64 v1, u64 v2) {
   Report("HWAddressSanitizer CHECK failed: %s:%d \"%s\" (0x%zx, 0x%zx)\n", file,

Modified: compiler-rt/trunk/lib/hwasan/hwasan.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/hwasan/hwasan.h?rev=346452&r1=346451&r2=346452&view=diff
==============================================================================
--- compiler-rt/trunk/lib/hwasan/hwasan.h (original)
+++ compiler-rt/trunk/lib/hwasan/hwasan.h Thu Nov  8 16:03:39 2018
@@ -104,8 +104,6 @@ struct SymbolizerScope {
   ~SymbolizerScope() { ExitSymbolizer(); }
 };
 
-void PrintWarning(uptr pc, uptr bp);
-
 void GetStackTrace(BufferedStackTrace *stack, uptr max_s, uptr pc, uptr bp,
                    void *context, bool request_fast_unwind);
 

Modified: compiler-rt/trunk/lib/hwasan/hwasan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/hwasan/hwasan_interceptors.cc?rev=346452&r1=346451&r2=346452&view=diff
==============================================================================
--- compiler-rt/trunk/lib/hwasan/hwasan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/hwasan/hwasan_interceptors.cc Thu Nov  8 16:03:39 2018
@@ -92,42 +92,6 @@ static void *AllocateFromLocalPool(uptr
 } while (0)
 
 
-
-#define HWASAN_READ_RANGE(ctx, offset, size) \
-  CHECK_UNPOISONED(offset, size)
-#define HWASAN_WRITE_RANGE(ctx, offset, size) \
-  CHECK_UNPOISONED(offset, size)
-
-
-
-// Check that [x, x+n) range is unpoisoned.
-#define CHECK_UNPOISONED_0(x, n)                                       \
-  do {                                                                 \
-    sptr __offset = __hwasan_test_shadow(x, n);                         \
-    if (__hwasan::IsInSymbolizer()) break;                              \
-    if (__offset >= 0) {                                               \
-      GET_CALLER_PC_BP_SP;                                             \
-      (void)sp;                                                        \
-      ReportInvalidAccessInsideAddressRange(__func__, x, n, __offset); \
-      __hwasan::PrintWarning(pc, bp);                                   \
-      if (__hwasan::flags()->halt_on_error) {                           \
-        Printf("Exiting\n");                                           \
-        Die();                                                         \
-      }                                                                \
-    }                                                                  \
-  } while (0)
-
-// Check that [x, x+n) range is unpoisoned unless we are in a nested
-// interceptor.
-#define CHECK_UNPOISONED(x, n)                             \
-  do {                                                     \
-    if (!IsInInterceptorScope()) CHECK_UNPOISONED_0(x, n); \
-  } while (0)
-
-#define CHECK_UNPOISONED_STRING_OF_LEN(x, len, n)               \
-  CHECK_UNPOISONED((x),                                         \
-    common_flags()->strict_string_checks ? (len) + 1 : (n) )
-
 int __sanitizer_posix_memalign(void **memptr, uptr alignment, uptr size) {
   GET_MALLOC_STACK_TRACE;
   CHECK_NE(memptr, 0);

Modified: compiler-rt/trunk/lib/hwasan/hwasan_report.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/hwasan/hwasan_report.cc?rev=346452&r1=346451&r2=346452&view=diff
==============================================================================
--- compiler-rt/trunk/lib/hwasan/hwasan_report.cc (original)
+++ compiler-rt/trunk/lib/hwasan/hwasan_report.cc Thu Nov  8 16:03:39 2018
@@ -228,36 +228,8 @@ void PrintAddressDescription(
     Printf("HWAddressSanitizer can not describe address in more detail.\n");
 }
 
-void ReportInvalidAccess(StackTrace *stack, u32 origin) {
-  ScopedErrorReportLock l;
-
-  Decorator d;
-  Printf("%s", d.Warning());
-  Report("WARNING: HWAddressSanitizer: invalid access\n");
-  Printf("%s", d.Default());
-  stack->Print();
-  ReportErrorSummary("invalid-access", stack);
-}
-
 void ReportStats() {}
 
-void ReportInvalidAccessInsideAddressRange(const char *what, const void *start,
-                                           uptr size, uptr offset) {
-  ScopedErrorReportLock l;
-  SavedStackAllocations current_stack_allocations(
-      GetCurrentThread()->stack_allocations());
-
-  Decorator d;
-  Printf("%s", d.Warning());
-  Printf("%sTag mismatch in %s%s%s at offset %zu inside [%p, %zu)%s\n",
-         d.Warning(), d.Name(), what, d.Warning(), offset, start, size,
-         d.Default());
-  PrintAddressDescription((uptr)start + offset, 1,
-                          current_stack_allocations.get());
-  // if (__sanitizer::Verbosity())
-  //   DescribeMemoryRange(start, size);
-}
-
 static void PrintTagsAroundAddr(tag_t *tag_ptr) {
   Printf(
       "Memory tags around the buggy address (one tag corresponds to %zd "

Modified: compiler-rt/trunk/lib/hwasan/hwasan_report.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/hwasan/hwasan_report.h?rev=346452&r1=346451&r2=346452&view=diff
==============================================================================
--- compiler-rt/trunk/lib/hwasan/hwasan_report.h (original)
+++ compiler-rt/trunk/lib/hwasan/hwasan_report.h Thu Nov  8 16:03:39 2018
@@ -21,10 +21,7 @@
 
 namespace __hwasan {
 
-void ReportInvalidAccess(StackTrace *stack, u32 origin);
 void ReportStats();
-void ReportInvalidAccessInsideAddressRange(const char *what, const void *start,
-                                           uptr size, uptr offset);
 void ReportTagMismatch(StackTrace *stack, uptr addr, uptr access_size,
                        bool is_store);
 void ReportInvalidFree(StackTrace *stack, uptr addr);




More information about the llvm-commits mailing list