[compiler-rt] d39d86d - [NFC][hwasan] Use unnamed namespace and static (#66682)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 17:17:21 PDT 2023


Author: Vitaly Buka
Date: 2023-09-18T17:16:01-07:00
New Revision: d39d86da4a451f7ecc6833bc6dc05bba25c3a41a

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

LOG: [NFC][hwasan] Use unnamed namespace and static (#66682)

Added: 
    

Modified: 
    compiler-rt/lib/hwasan/hwasan_report.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/hwasan/hwasan_report.cpp b/compiler-rt/lib/hwasan/hwasan_report.cpp
index 436eb37b793fc04..062d3131f8c7c4a 100644
--- a/compiler-rt/lib/hwasan/hwasan_report.cpp
+++ b/compiler-rt/lib/hwasan/hwasan_report.cpp
@@ -108,6 +108,7 @@ static void MaybePrintAndroidHelpUrl() {
 #endif
 }
 
+namespace {
 // A RAII object that holds a copy of the current thread stack ring buffer.
 // The actual stack buffer may change while we are iterating over it (for
 // example, Printf may call syslog() which can itself be built with hwasan).
@@ -143,6 +144,7 @@ class Decorator: public __sanitizer::SanitizerCommonDecorator {
   const char *Location() { return Green(); }
   const char *Thread() { return Green(); }
 };
+}  // namespace
 
 static bool FindHeapAllocation(HeapAllocationsRingBuffer *rb, uptr tagged_addr,
                                HeapAllocationRecord *har, uptr *ring_index,
@@ -373,7 +375,7 @@ static void ShowHeapOrGlobalCandidate(uptr untagged_addr, tag_t *candidate,
   }
 }
 
-void PrintAddressDescription(
+static void PrintAddressDescription(
     uptr tagged_addr, uptr access_size,
     StackAllocationsRingBuffer *current_stack_allocations) {
   Decorator d;
@@ -564,7 +566,7 @@ static void PrintTagsAroundAddr(tag_t *tag_ptr) {
       "description of short granule tags\n");
 }
 
-uptr GetTopPc(StackTrace *stack) {
+static uptr GetTopPc(StackTrace *stack) {
   return stack->size ? StackTrace::GetPreviousInstructionPc(stack->trace[0])
                      : 0;
 }


        


More information about the llvm-commits mailing list