[PATCH] D33286: Don't require ThreadState to be contained within tls on all platforms

Dmitry Vyukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 22 00:59:35 PDT 2017


dvyukov added a comment.

Yes, please do this only for Darwin. These things are extremely fragile, it's nice to be able to rely at least on some things. If we change it to if, it will silently break on other platforms and we will not notice.
You can either move some code to platform* files, or merely provide a flag in platform* files and use it here.

Also, if there is tls, but ThreadState is not there, we still need to do:

  MemoryRangeImitateWrite(thr, /*pc=*/2, tls_addr, tls_size);

There checks are merely to avoid writing to ThreadState to improve performance.

Also please fix the change description: we don't store thread state pointer in tls, we store whole ThreadState object in tls.


https://reviews.llvm.org/D33286





More information about the llvm-commits mailing list