diff options
| author | Jonathan Roelofs <jonathan@codesourcery.com> | 2014-09-05 17:46:40 +0000 |
|---|---|---|
| committer | Jonathan Roelofs <jonathan@codesourcery.com> | 2014-09-05 17:46:40 +0000 |
| commit | 3b7f085db18e690458f9f594d31489bf75354fec (patch) | |
| tree | 4ef767803f60d9ef2384c154d39678f0543420d1 /libcxxabi | |
| parent | 3547c5441e468ab82e85cc1285eff75bc18c639a (diff) | |
| download | bcm5719-llvm-3b7f085db18e690458f9f594d31489bf75354fec.tar.gz bcm5719-llvm-3b7f085db18e690458f9f594d31489bf75354fec.zip | |
s/LIBCXXABI_SINGLE_THREADED/LIBCXXABI_HAS_NO_THREADS/ for consistency with libcxx
Also remove the audotedection part so that if you're crazy enough to want a
single-threaded abi library, you'll say so explicitly in the build.
llvm-svn: 217262
Diffstat (limited to 'libcxxabi')
| -rw-r--r-- | libcxxabi/src/config.h | 8 | ||||
| -rw-r--r-- | libcxxabi/src/cxa_exception.cpp | 2 | ||||
| -rw-r--r-- | libcxxabi/src/cxa_exception_storage.cpp | 2 | ||||
| -rw-r--r-- | libcxxabi/src/cxa_guard.cpp | 10 | ||||
| -rw-r--r-- | libcxxabi/src/fallback_malloc.ipp | 6 | ||||
| -rw-r--r-- | libcxxabi/test/test_exception_storage.cpp | 6 |
6 files changed, 16 insertions, 18 deletions
diff --git a/libcxxabi/src/config.h b/libcxxabi/src/config.h index 57d92fbaddb..ac6d297d113 100644 --- a/libcxxabi/src/config.h +++ b/libcxxabi/src/config.h @@ -16,11 +16,9 @@ #include <unistd.h> -#if !defined(LIBCXXABI_SINGLE_THREADED) && \ - defined(_POSIX_THREADS) && _POSIX_THREADS > 0 -# define LIBCXXABI_SINGLE_THREADED 0 -#else -# define LIBCXXABI_SINGLE_THREADED 1 +// Set this in the CXXFLAGS when you need it +#if !defined(LIBCXXABI_HAS_NO_THREADS) +# define LIBCXXABI_HAS_NO_THREADS 0 #endif // Set this in the CXXFLAGS when you need it, because otherwise we'd have to diff --git a/libcxxabi/src/cxa_exception.cpp b/libcxxabi/src/cxa_exception.cpp index d5bc74ab1b1..e9f5e6ea666 100644 --- a/libcxxabi/src/cxa_exception.cpp +++ b/libcxxabi/src/cxa_exception.cpp @@ -17,7 +17,7 @@ #include <exception> // for std::terminate #include <cstdlib> // for malloc, free #include <cstring> // for memset -#if !LIBCXXABI_SINGLE_THREADED +#if !LIBCXXABI_HAS_NO_THREADS # include <pthread.h> // for fallback_malloc.ipp's mutexes #endif #include "cxa_exception.hpp" diff --git a/libcxxabi/src/cxa_exception_storage.cpp b/libcxxabi/src/cxa_exception_storage.cpp index 6f902c68873..a39b6db005f 100644 --- a/libcxxabi/src/cxa_exception_storage.cpp +++ b/libcxxabi/src/cxa_exception_storage.cpp @@ -15,7 +15,7 @@ #include "config.h" -#if LIBCXXABI_SINGLE_THREADED +#if LIBCXXABI_HAS_NO_THREADS namespace __cxxabiv1 { extern "C" { diff --git a/libcxxabi/src/cxa_guard.cpp b/libcxxabi/src/cxa_guard.cpp index c6ac89f8cdf..5372a5ccf3c 100644 --- a/libcxxabi/src/cxa_guard.cpp +++ b/libcxxabi/src/cxa_guard.cpp @@ -10,7 +10,7 @@ #include "abort_message.h" #include "config.h" -#if !LIBCXXABI_SINGLE_THREADED +#if !LIBCXXABI_HAS_NO_THREADS # include <pthread.h> #endif #include <stdint.h> @@ -62,7 +62,7 @@ void set_initialized(guard_type* guard_object) { #endif -#if !LIBCXXABI_SINGLE_THREADED +#if !LIBCXXABI_HAS_NO_THREADS pthread_mutex_t guard_mut = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t guard_cv = PTHREAD_COND_INITIALIZER; #endif @@ -166,7 +166,7 @@ set_lock(uint32_t& x, lock_type y) extern "C" { -#if LIBCXXABI_SINGLE_THREADED +#if LIBCXXABI_HAS_NO_THREADS int __cxa_guard_acquire(guard_type* guard_object) { return !is_initialized(guard_object); @@ -183,7 +183,7 @@ void __cxa_guard_abort(guard_type* guard_object) *guard_object = 0; } -#else // !LIBCXXABI_SINGLE_THREADED +#else // !LIBCXXABI_HAS_NO_THREADS int __cxa_guard_acquire(guard_type* guard_object) { @@ -250,7 +250,7 @@ void __cxa_guard_abort(guard_type* guard_object) abort_message("__cxa_guard_abort failed to broadcast condition variable"); } -#endif // !LIBCXXABI_SINGLE_THREADED +#endif // !LIBCXXABI_HAS_NO_THREADS } // extern "C" diff --git a/libcxxabi/src/fallback_malloc.ipp b/libcxxabi/src/fallback_malloc.ipp index a97f3fd45f2..135d4891a6b 100644 --- a/libcxxabi/src/fallback_malloc.ipp +++ b/libcxxabi/src/fallback_malloc.ipp @@ -26,7 +26,7 @@ namespace { // When POSIX threads are not available, make the mutex operations a nop -#if LIBCXXABI_SINGLE_THREADED +#if LIBCXXABI_HAS_NO_THREADS static void * heap_mutex = 0; #else static pthread_mutex_t heap_mutex = PTHREAD_MUTEX_INITIALIZER; @@ -34,7 +34,7 @@ static pthread_mutex_t heap_mutex = PTHREAD_MUTEX_INITIALIZER; class mutexor { public: -#if LIBCXXABI_SINGLE_THREADED +#if LIBCXXABI_HAS_NO_THREADS mutexor ( void * ) {} ~mutexor () {} #else @@ -44,7 +44,7 @@ public: private: mutexor ( const mutexor &rhs ); mutexor & operator = ( const mutexor &rhs ); -#if !LIBCXXABI_SINGLE_THREADED +#if !LIBCXXABI_HAS_NO_THREADS pthread_mutex_t *mtx_; #endif }; diff --git a/libcxxabi/test/test_exception_storage.cpp b/libcxxabi/test/test_exception_storage.cpp index f1d63fdfc43..f1e2fb5e477 100644 --- a/libcxxabi/test/test_exception_storage.cpp +++ b/libcxxabi/test/test_exception_storage.cpp @@ -12,7 +12,7 @@ #include <cstdlib> #include <algorithm> #include <iostream> -#if !LIBCXXABI_SINGLE_THREADED +#if !LIBCXXABI_HAS_NO_THREADS # include <pthread.h> #endif #include <unistd.h> @@ -38,7 +38,7 @@ void *thread_code (void *parm) { return parm; } -#if !LIBCXXABI_SINGLE_THREADED +#if !LIBCXXABI_HAS_NO_THREADS #define NUMTHREADS 10 size_t thread_globals [ NUMTHREADS ] = { 0 }; pthread_t threads [ NUMTHREADS ]; @@ -54,7 +54,7 @@ void print_sizes ( size_t *first, size_t *last ) { int main ( int argc, char *argv [] ) { int retVal = 0; -#if LIBCXXABI_SINGLE_THREADED +#if LIBCXXABI_HAS_NO_THREADS size_t thread_globals; retVal = thread_code(&thread_globals) != 0; #else |

