summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-06-26 17:13:58 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-06-26 17:13:58 +0000
commitda72dd2a01a9f3e686699d01f4d40b936a52eab6 (patch)
tree2440d3e283e9455676638517af6e4984a1509180 /lib
parent34f5a2b596236a5452ddc664066138ca7a0c7af2 (diff)
downloadllvm-da72dd2a01a9f3e686699d01f4d40b936a52eab6.tar.gz
llvm-da72dd2a01a9f3e686699d01f4d40b936a52eab6.tar.bz2
llvm-da72dd2a01a9f3e686699d01f4d40b936a52eab6.tar.xz
Fix ThreadLocalImpl::getInstance for --disable-threads.
PR13114. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159210 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Support/ThreadLocal.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Support/ThreadLocal.cpp b/lib/Support/ThreadLocal.cpp
index 109580478d..0587aaec7e 100644
--- a/lib/Support/ThreadLocal.cpp
+++ b/lib/Support/ThreadLocal.cpp
@@ -30,10 +30,12 @@ void ThreadLocalImpl::setInstance(const void* d) {
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