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

Argyrios Kyrtzidis akyrtzi at gmail.com
Tue Jun 26 10:13:59 PDT 2012


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.

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





More information about the llvm-commits mailing list