[compiler-rt] [asan] Speed up ASan ODR indicator-based checking (PR #100923)

Artem Pianykh via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 15:06:45 PDT 2024


================
@@ -225,10 +248,12 @@ static void RegisterGlobal(const Global *g) {
   }
   if (CanPoisonMemory())
     PoisonRedZones(*g);
-  ListOfGlobals *l = new (GetGlobalLowLevelAllocator()) ListOfGlobals;
-  l->g = g;
-  l->next = list_of_all_globals;
-  list_of_all_globals = l;
+
+  AddGlobalToList(list_of_all_globals, g);
+
+  if (UseODRIndicator(g) && g->odr_indicator != UINTPTR_MAX)
----------------
artempyanykh wrote:

I can do that. The only concern is that `Check` will be more like `CheckAndAdd` rather than just doing checking. OTOH we won't need to repeat this guard.

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


More information about the llvm-commits mailing list