projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
34f5a2b
)
Fix ThreadLocalImpl::getInstance for --disable-threads.
author
Argyrios Kyrtzidis
<akyrtzi@gmail.com>
Tue, 26 Jun 2012 17:13:58 +0000
(17:13 +0000)
committer
Argyrios Kyrtzidis
<akyrtzi@gmail.com>
Tue, 26 Jun 2012 17:13:58 +0000
(17:13 +0000)
PR13114.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159210
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Support/ThreadLocal.cpp
patch
|
blob
|
history
diff --git
a/lib/Support/ThreadLocal.cpp
b/lib/Support/ThreadLocal.cpp
index 109580478deeb6003cc615cb246503813a428ed2..0587aaec7e68fc2c9ca6dacef2095610dac2c2c1 100644
(file)
--- 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