This is an archive of the discontinued LLVM Phabricator instance.

tsan: allow usage of global vars with ctors in interceptors
ClosedPublic

Authored by dvyukov on Nov 7 2017, 2:22 AM.

Details

Summary

We allow usage of global/per-thread data with non-trivial ctors/dtors
throughout tsan code base by placing all global/per-thread data into
Context/ThreadState and then explicitly constructing them with
placement new. This greatly simplifies code by restricting the
"linker initialized plague" to only these 2 objects.

Do the same for interceptors data.

This allows to use Vector instead of bunch of hand-written code in:
https://reviews.llvm.org/D39619

Diff Detail

Event Timeline

dvyukov created this revision.Nov 7 2017, 2:22 AM
krytarowski accepted this revision.Nov 7 2017, 8:30 AM
This revision is now accepted and ready to land.Nov 7 2017, 8:30 AM
dvyukov closed this revision.Nov 7 2017, 8:31 AM

Committed as 317587.