[compiler-rt] r354696 - [NFC][Sanitizer] Rename BufferedStackTrace::FastUnwindStack

Julian Lettner via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 22 14:03:10 PST 2019


Author: yln
Date: Fri Feb 22 14:03:09 2019
New Revision: 354696

URL: http://llvm.org/viewvc/llvm-project?rev=354696&view=rev
Log:
[NFC][Sanitizer] Rename BufferedStackTrace::FastUnwindStack

FastUnwindStack -> UnwindFast
SlowUnwindStack -> UnwindSlow
Stack is redundant, verb should come first.

SlowUnwindStackWithContext(uptr pc, void *context, u32 max_depth) ->
SlowUnwindStack
WithContext is redundant, since it is a required parameter.

Reviewers: vitalybuka

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

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace_sparc.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_markup.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_win.cc
    compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc?rev=354696&r1=354695&r2=354696&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc Fri Feb 22 14:03:09 2019
@@ -68,8 +68,8 @@ static inline uhwptr *GetCanonicFrame(up
 #endif
 }
 
-void BufferedStackTrace::FastUnwindStack(uptr pc, uptr bp, uptr stack_top,
-                                         uptr stack_bottom, u32 max_depth) {
+void BufferedStackTrace::UnwindFast(uptr pc, uptr bp, uptr stack_top,
+                                    uptr stack_bottom, u32 max_depth) {
   const uptr kPageSize = GetPageSizeCached();
   CHECK_GE(max_depth, 2);
   trace_buffer[0] = pc;

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.h?rev=354696&r1=354695&r2=354696&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.h Fri Feb 22 14:03:09 2019
@@ -105,11 +105,10 @@ struct BufferedStackTrace : public Stack
   }
 
  private:
-  void FastUnwindStack(uptr pc, uptr bp, uptr stack_top, uptr stack_bottom,
-                       u32 max_depth);
-  void SlowUnwindStack(uptr pc, u32 max_depth);
-  void SlowUnwindStackWithContext(uptr pc, void *context,
-                                  u32 max_depth);
+  void UnwindFast(uptr pc, uptr bp, uptr stack_top, uptr stack_bottom,
+                  u32 max_depth);
+  void UnwindSlow(uptr pc, u32 max_depth);
+  void UnwindSlow(uptr pc, void *context, u32 max_depth);
   void PopStackFrames(uptr count);
   uptr LocatePcInTrace(uptr pc);
 

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc?rev=354696&r1=354695&r2=354696&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc Fri Feb 22 14:03:09 2019
@@ -71,14 +71,14 @@ void BufferedStackTrace::Unwind(u32 max_
   if (!WillUseFastUnwind(request_fast_unwind)) {
 #if SANITIZER_CAN_SLOW_UNWIND
     if (context)
-      SlowUnwindStackWithContext(pc, context, max_depth);
+      UnwindSlow(pc, context, max_depth);
     else
-      SlowUnwindStack(pc, max_depth);
+      UnwindSlow(pc, max_depth);
 #else
     UNREACHABLE("slow unwind requested but not available");
 #endif
   } else {
-    FastUnwindStack(pc, bp, stack_top, stack_bottom, max_depth);
+    UnwindFast(pc, bp, stack_top, stack_bottom, max_depth);
   }
 }
 

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace_sparc.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace_sparc.cc?rev=354696&r1=354695&r2=354696&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace_sparc.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace_sparc.cc Fri Feb 22 14:03:09 2019
@@ -21,8 +21,8 @@
 
 namespace __sanitizer {
 
-void BufferedStackTrace::FastUnwindStack(uptr pc, uptr bp, uptr stack_top,
-                                         uptr stack_bottom, u32 max_depth) {
+void BufferedStackTrace::UnwindFast(uptr pc, uptr bp, uptr stack_top,
+                                    uptr stack_bottom, u32 max_depth) {
   const uptr kPageSize = GetPageSizeCached();
   CHECK_GE(max_depth, 2);
   trace_buffer[0] = pc;

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_markup.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_markup.cc?rev=354696&r1=354695&r2=354696&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_markup.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_markup.cc Fri Feb 22 14:03:09 2019
@@ -117,7 +117,7 @@ _Unwind_Reason_Code Unwind_Trace(struct
                                              : _URC_NO_REASON);
 }
 
-void BufferedStackTrace::SlowUnwindStack(uptr pc, u32 max_depth) {
+void BufferedStackTrace::UnwindSlow(uptr pc, u32 max_depth) {
   CHECK_GE(max_depth, 2);
   size = 0;
   UnwindTraceArg arg = {this, Min(max_depth + 1, kStackTraceMax)};
@@ -132,7 +132,7 @@ void BufferedStackTrace::SlowUnwindStack
   trace_buffer[0] = pc;
 }
 
-void BufferedStackTrace::SlowUnwindStackWithContext(uptr pc, void *context,
+void BufferedStackTrace::UnwindSlow(uptr pc, void *context,
                                                     u32 max_depth) {
   CHECK_NE(context, nullptr);
   UNREACHABLE("signal context doesn't exist");

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc?rev=354696&r1=354695&r2=354696&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc Fri Feb 22 14:03:09 2019
@@ -27,7 +27,7 @@
 
 namespace __sanitizer {
 
-//------------------------- SlowUnwindStack -----------------------------------
+//---------------------------- UnwindSlow --------------------------------------
 
 typedef struct {
   uptr absolute_pc;
@@ -119,7 +119,7 @@ _Unwind_Reason_Code Unwind_Trace(struct
   return UNWIND_CONTINUE;
 }
 
-void BufferedStackTrace::SlowUnwindStack(uptr pc, u32 max_depth) {
+void BufferedStackTrace::UnwindSlow(uptr pc, u32 max_depth) {
   CHECK_GE(max_depth, 2);
   size = 0;
   UnwindTraceArg arg = {this, Min(max_depth + 1, kStackTraceMax)};
@@ -138,11 +138,11 @@ void BufferedStackTrace::SlowUnwindStack
   trace_buffer[0] = pc;
 }
 
-void BufferedStackTrace::SlowUnwindStackWithContext(uptr pc, void *context,
+void BufferedStackTrace::UnwindSlow(uptr pc, void *context,
                                                     u32 max_depth) {
   CHECK_GE(max_depth, 2);
   if (!unwind_backtrace_signal_arch) {
-    SlowUnwindStack(pc, max_depth);
+    UnwindSlow(pc, max_depth);
     return;
   }
 

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_win.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_win.cc?rev=354696&r1=354695&r2=354696&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_win.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_win.cc Fri Feb 22 14:03:09 2019
@@ -24,7 +24,7 @@
 using namespace __sanitizer;
 
 #if !SANITIZER_GO
-void BufferedStackTrace::SlowUnwindStack(uptr pc, u32 max_depth) {
+void BufferedStackTrace::UnwindSlow(uptr pc, u32 max_depth) {
   CHECK_GE(max_depth, 2);
   // FIXME: CaptureStackBackTrace might be too slow for us.
   // FIXME: Compare with StackWalk64.
@@ -39,7 +39,7 @@ void BufferedStackTrace::SlowUnwindStack
   PopStackFrames(pc_location);
 }
 
-void BufferedStackTrace::SlowUnwindStackWithContext(uptr pc, void *context,
+void BufferedStackTrace::UnwindSlow(uptr pc, void *context,
   u32 max_depth) {
   CONTEXT ctx = *(CONTEXT *)context;
   STACKFRAME64 stack_frame;

Modified: compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cc?rev=354696&r1=354695&r2=354696&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cc Fri Feb 22 14:03:09 2019
@@ -58,9 +58,9 @@ void FastUnwindTest::SetUp() {
   // Mark the last fp point back up to terminate the stack trace.
   fake_stack[RoundDownTo(fake_stack_size - 1, 2)] = (uhwptr)&fake_stack[0];
 
-  // Top is two slots past the end because FastUnwindStack subtracts two.
+  // Top is two slots past the end because UnwindFast subtracts two.
   fake_top = (uhwptr)&fake_stack[fake_stack_size + 2];
-  // Bottom is one slot before the start because FastUnwindStack uses >.
+  // Bottom is one slot before the start because UnwindFast uses >.
   fake_bottom = (uhwptr)mapping;
   start_pc = PC(0);
 }




More information about the llvm-commits mailing list