[llvm] d351f54 - [Support] Remove unused/uncompilable !HAVE_PTHREAD_GETSPECIFIC code path
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 11 14:20:37 PDT 2022
Author: Fangrui Song
Date: 2022-04-11T14:20:33-07:00
New Revision: d351f54a076edf24c2a2bfda7cc7e3313ee3eecf
URL: https://github.com/llvm/llvm-project/commit/d351f54a076edf24c2a2bfda7cc7e3313ee3eecf
DIFF: https://github.com/llvm/llvm-project/commit/d351f54a076edf24c2a2bfda7cc7e3313ee3eecf.diff
LOG: [Support] Remove unused/uncompilable !HAVE_PTHREAD_GETSPECIFIC code path
lib/Support/ThreadLocal.cpp has been uncompilable since rL158346 (2012-06) when
`data` became a char array. The error looks like
```
...llvm/lib/Support/Unix/ThreadLocal.inc:66:57: error: array type 'char[8]' is not assignable
void ThreadLocalImpl::setInstance(const void* d) { data = const_cast<void*>(d);}
```
Added:
Modified:
llvm/lib/Support/Unix/ThreadLocal.inc
Removed:
################################################################################
diff --git a/llvm/lib/Support/Unix/ThreadLocal.inc b/llvm/lib/Support/Unix/ThreadLocal.inc
index a402ae980424e..0a958a2b952f7 100644
--- a/llvm/lib/Support/Unix/ThreadLocal.inc
+++ b/llvm/lib/Support/Unix/ThreadLocal.inc
@@ -17,8 +17,6 @@
#include "llvm/Config/config.h"
-#if defined(HAVE_PTHREAD_H) && defined(HAVE_PTHREAD_GETSPECIFIC)
-
#include <cassert>
#include <pthread.h>
#include <stdlib.h>
@@ -58,13 +56,3 @@ void ThreadLocalImpl::removeInstance() {
}
}
-#else
-namespace llvm {
-using namespace sys;
-ThreadLocalImpl::ThreadLocalImpl() : data() { }
-ThreadLocalImpl::~ThreadLocalImpl() { }
-void ThreadLocalImpl::setInstance(const void* d) { data = const_cast<void*>(d);}
-void *ThreadLocalImpl::getInstance() { return data; }
-void ThreadLocalImpl::removeInstance() { setInstance(0); }
-}
-#endif
More information about the llvm-commits
mailing list