Skip to content

Commit

Permalink
[Support] Remove unused/uncompilable !HAVE_PTHREAD_GETSPECIFIC code path
Browse files Browse the repository at this point in the history
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);}
```
  • Loading branch information
MaskRay committed Apr 11, 2022
1 parent a0570e7 commit d351f54
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions llvm/lib/Support/Unix/ThreadLocal.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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

0 comments on commit d351f54

Please sign in to comment.