[compiler-rt] [tsan] Allow unloading of ignored libraries (PR #105660)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 16 05:47:10 PDT 2024


================
@@ -54,20 +54,26 @@ class LibIgnore {
     char *name;
     char *real_name;  // target of symlink
     bool loaded;
+    uptr ignored_code_range_id;
   };
 
   struct LibCodeRange {
     uptr begin;
-    uptr end;
+    // A value of 0 means the associated module was unloaded.
+    atomic_uintptr_t end;
+    bool IsInRange(uptr pc) const {
+      return (pc >= begin && pc < atomic_load(&end, memory_order_relaxed));
+    }
   };
 
-  inline bool IsInRange(uptr pc, const LibCodeRange &range) const {
-    return (pc >= range.begin && pc < range.end);
-  }
+  static_assert(sizeof(LibCodeRange) == 16,
----------------
goussepi wrote:

Yes I think this assert is not needed thanks!

https://github.com/llvm/llvm-project/pull/105660


More information about the llvm-commits mailing list