[llvm] r227300 - [LPM] Rip all of ManagedStatic and ThreadLocal out of the pretty stack

Owen Anderson resistor at mac.com
Wed Jan 28 14:14:49 PST 2015


Hi Chandler,

> On Jan 28, 2015, at 1:52 AM, Chandler Carruth <chandlerc at gmail.com> wrote:
> 
> -static ManagedStatic<sys::ThreadLocal<const PrettyStackTraceEntry> > PrettyStackTraceHead;
> +// We need a thread local pointer to manage the stack of our stack trace
> +// objects, but we *really* cannot tolerate destructors running and do not want
> +// to pay any overhead of synchronizing. As a consequence, we use a raw
> +// thread-local variable. Some day, we should be able to use a limited subset
> +// of C++11's thread_local, but compilers aren't up for it today.
> +// FIXME: This should be moved to a Compiler.h abstraction.
> +#ifdef _MSC_VER // MSVC supports this with a __declspec.
> +static __declspec(thread) const PrettyStackTraceEntry
> +    *PrettyStackTraceHead = nullptr;
> +#else // Clang, GCC, and all compatible compilers tend to use __thread.
> +static __thread const PrettyStackTraceEntry *PrettyStackTraceHead = nullptr;
> +#endif

Darwin doesn’t support __thread or thread_local on armv7 or arm64.  This is breaking all Darwin embedded builds.  :-(

—Owen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150128/18422760/attachment.html>


More information about the llvm-commits mailing list