why 'const' void * return for ThreadLocalImpl::getInstance()?

I’m probably missing something obvious here, but naively, this makes it kind of awkward to have mutable thread local state…

I think you are supposed to use ThreadLocal::get in cases where you want a pointer to mutable data: http://llvm.org/docs/doxygen/html/classllvm_1_1sys_1_1ThreadLocal.html#a66c83dcd38d9048a4f95255e44f13a0c

Yeah, I was using that – I have, more or less,

struct S {…};

llvm::sys::ThreadLocal TLS;

S * s = TLS.get();

The static_cast in ThreadLocal::get is where the compiler gripes…. Unable to convert from ‘const void *’ to ‘S *’.

Should be fixed with r224225.