HomePhabricator

[XRay][compiler-rt][NFC] Refactor global TLS variables behind an accessor…

Authored by dberris on Aug 29 2017, 5:21 AM.

Description

[XRay][compiler-rt][NFC] Refactor global TLS variables behind an accessor function.

Summary:
This change hides all the initialization of thread_local variables used
by the XRay FDR mode implementation behind a function call. This makes
initialization of thread-local data to be done lazily, instead of
eagerly when they're done as globals. It also gives us an isolation
mechanism if/when we want to change the TLS implementation from using
the C++ thread_local keyword, for something more ad-hoc (potentialy
using pthread directly) on some platforms or set-ups where we cannot use
the C++ thread_local variables.

Reviewers: kpw, eizan

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D37248

llvm-svn: 311997