[compiler-rt] e412cc4 - [asan] Dedup MemToShadowSize

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 02:40:18 PDT 2020


Author: Vitaly Buka
Date: 2020-07-17T02:40:08-07:00
New Revision: e412cc402e84444ff13cc4e4ae4c2c5830f9d9da

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

LOG: [asan] Dedup MemToShadowSize

Added D83247 and D84004.

Added: 
    

Modified: 
    compiler-rt/lib/asan/asan_mapping.h
    compiler-rt/lib/asan/asan_mapping_sparc64.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/asan/asan_mapping.h b/compiler-rt/lib/asan/asan_mapping.h
index c64c03356731..36e2cb5364f3 100644
--- a/compiler-rt/lib/asan/asan_mapping.h
+++ b/compiler-rt/lib/asan/asan_mapping.h
@@ -304,7 +304,6 @@ extern uptr kHighMemEnd, kMidMemBeg, kMidMemEnd;  // Initialized in __asan_init.
 
 namespace __asan {
 
-static inline uptr MemToShadowSize(uptr size) { return size >> SHADOW_SCALE; }
 static inline bool AddrIsInLowMem(uptr a) {
   PROFILE_ASAN_MAPPING();
   return a <= kLowMemEnd;
@@ -356,6 +355,8 @@ static inline bool AddrIsInShadowGap(uptr a) {
 
 namespace __asan {
 
+static inline uptr MemToShadowSize(uptr size) { return size >> SHADOW_SCALE; }
+
 static inline bool AddrIsInMem(uptr a) {
   PROFILE_ASAN_MAPPING();
   return AddrIsInLowMem(a) || AddrIsInMidMem(a) || AddrIsInHighMem(a) ||

diff  --git a/compiler-rt/lib/asan/asan_mapping_sparc64.h b/compiler-rt/lib/asan/asan_mapping_sparc64.h
index 167ef154e79b..432a1816f797 100644
--- a/compiler-rt/lib/asan/asan_mapping_sparc64.h
+++ b/compiler-rt/lib/asan/asan_mapping_sparc64.h
@@ -61,7 +61,6 @@
 
 namespace __asan {
 
-static inline uptr MemToShadowSize(uptr size) { return size >> SHADOW_SCALE; }
 static inline bool AddrIsInLowMem(uptr a) {
   PROFILE_ASAN_MAPPING();
   return a <= kLowMemEnd;


        


More information about the llvm-commits mailing list