[llvm-commits] [llvm] r159210 - /llvm/trunk/lib/Support/ThreadLocal.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Tue Jun 26 14:24:05 PDT 2012


On Jun 26, 2012, at 2:08 PM, Bill Wendling wrote:

> On Jun 26, 2012, at 10:13 AM, Argyrios Kyrtzidis wrote:
> 
>> Author: akirtzidis
>> Date: Tue Jun 26 12:13:58 2012
>> New Revision: 159210
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=159210&view=rev
>> Log:
>> Fix ThreadLocalImpl::getInstance for --disable-threads.
>> 
> Fix what?

It returned the address of 'data' instead of the value stored in 'data', causing assertion hits when building with --disable-threads.

> Please be more descriptive in future commit messages. :-)

I shall! :-)

> 
> -bw
> 
>> PR13114.
>> 
>> Modified:
>>   llvm/trunk/lib/Support/ThreadLocal.cpp
>> 
>> Modified: llvm/trunk/lib/Support/ThreadLocal.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/ThreadLocal.cpp?rev=159210&r1=159209&r2=159210&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Support/ThreadLocal.cpp (original)
>> +++ llvm/trunk/lib/Support/ThreadLocal.cpp Tue Jun 26 12:13:58 2012
>> @@ -30,10 +30,12 @@
>>  void **pd = reinterpret_cast<void**>(&data);
>>  *pd = const_cast<void*>(d);
>> }
>> -const void* ThreadLocalImpl::getInstance() { return data; }
>> -void ThreadLocalImpl::removeInstance() {
>> +const void* ThreadLocalImpl::getInstance() {
>>  void **pd = reinterpret_cast<void**>(&data);
>> -  *pd = 0;
>> +  return *pd;
>> +}
>> +void ThreadLocalImpl::removeInstance() {
>> +  setInstance(0);
>> }
>> }
>> #else
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 





More information about the llvm-commits mailing list