[compiler-rt] 2468b3f - [XRay] Unsupport version<2 sled entry

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 28 18:08:35 PST 2022


Author: Fangrui Song
Date: 2022-12-28T18:08:30-08:00
New Revision: 2468b3f57218458dc6b9aea13682533a74c52ce6

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

LOG: [XRay] Unsupport version<2 sled entry

For many features we expect clang and compiler-rt to have a version lock
relation, yet for XRaySledEntry we have kept version<2 compatibility for more
than 2 years (I migrated away the last user mips in 2020-09 (D87977)).
I think it's fair to call an end to version<2 now. This should discourage more
work on version<2 (e.g. D140725).

Reviewed By: ianlevesque

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

Added: 
    

Modified: 
    compiler-rt/lib/xray/xray_interface_internal.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/xray/xray_interface_internal.h b/compiler-rt/lib/xray/xray_interface_internal.h
index 390f389b1dca..8c5973c58351 100644
--- a/compiler-rt/lib/xray/xray_interface_internal.h
+++ b/compiler-rt/lib/xray/xray_interface_internal.h
@@ -30,14 +30,10 @@ struct XRaySledEntry {
   unsigned char Version;
   unsigned char Padding[13]; // Need 32 bytes
   uint64_t function() const {
-    if (Version < 2)
-      return Function;
     // The target address is relative to the location of the Function variable.
     return reinterpret_cast<uint64_t>(&Function) + Function;
   }
   uint64_t address() const {
-    if (Version < 2)
-      return Address;
     // The target address is relative to the location of the Address variable.
     return reinterpret_cast<uint64_t>(&Address) + Address;
   }
@@ -49,14 +45,10 @@ struct XRaySledEntry {
   unsigned char Version;
   unsigned char Padding[5]; // Need 16 bytes
   uint32_t function() const {
-    if (Version < 2)
-      return Function;
     // The target address is relative to the location of the Function variable.
     return reinterpret_cast<uint32_t>(&Function) + Function;
   }
   uint32_t address() const {
-    if (Version < 2)
-      return Address;
     // The target address is relative to the location of the Address variable.
     return reinterpret_cast<uint32_t>(&Address) + Address;
   }


        


More information about the llvm-commits mailing list