[PATCH] Add process name to Asan logfile name and report message
Yury Gribov
tetra2005 at gmail.com
Tue Dec 2 04:02:16 PST 2014
Something like this seems to work
+#define DEFINE_LINKER_INITIALIZED_OBJECT(type, name) \
+ static uptr __ ## name ## _bytes [(sizeof(type) + sizeof(u64) - 1) / sizeof(u64)]; \
+ static type & name = reinterpret_cast<type &>(__ ## name ## _bytes[0]);
...
-static BlockingMutex binary_name_cache_lock(LINKER_INITIALIZED);
+DEFINE_LINKER_INITIALIZED_OBJECT(BlockingMutex, binary_name_cache_lock);
static char binary_name_cache_str[kMaxPathLength];
static bool binary_name_cache_initialized = false;
Does this approach make sense?
http://reviews.llvm.org/D5724
More information about the llvm-commits
mailing list