mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Instead of defining LLVM_MULTITHREADED as 0 or 1, define or undefine it,
and test appropriately. Otherwise it might erroneously pick up some pthread primitives, and fail to link.
This commit is contained in:
parent
ded66df8cb
commit
86b360ada3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=219076
@ -22,7 +22,7 @@ using namespace llvm;
|
||||
#endif
|
||||
|
||||
void sys::MemoryFence() {
|
||||
#if LLVM_MULTITHREADED==0
|
||||
#if !defined(LLVM_MULTITHREADED)
|
||||
return;
|
||||
#else
|
||||
# if defined(__GNUC__)
|
||||
@ -38,7 +38,7 @@ void sys::MemoryFence() {
|
||||
sys::cas_flag sys::CompareAndSwap(volatile sys::cas_flag* ptr,
|
||||
sys::cas_flag new_value,
|
||||
sys::cas_flag old_value) {
|
||||
#if LLVM_MULTITHREADED==0
|
||||
#if !defined(LLVM_MULTITHREADED)
|
||||
sys::cas_flag result = *ptr;
|
||||
if (result == old_value)
|
||||
*ptr = new_value;
|
||||
@ -53,7 +53,7 @@ sys::cas_flag sys::CompareAndSwap(volatile sys::cas_flag* ptr,
|
||||
}
|
||||
|
||||
sys::cas_flag sys::AtomicIncrement(volatile sys::cas_flag* ptr) {
|
||||
#if LLVM_MULTITHREADED==0
|
||||
#if !defined(LLVM_MULTITHREADED)
|
||||
++(*ptr);
|
||||
return *ptr;
|
||||
#elif defined(__GNUC__)
|
||||
@ -66,7 +66,7 @@ sys::cas_flag sys::AtomicIncrement(volatile sys::cas_flag* ptr) {
|
||||
}
|
||||
|
||||
sys::cas_flag sys::AtomicDecrement(volatile sys::cas_flag* ptr) {
|
||||
#if LLVM_MULTITHREADED==0
|
||||
#if !defined(LLVM_MULTITHREADED)
|
||||
--(*ptr);
|
||||
return *ptr;
|
||||
#elif defined(__GNUC__)
|
||||
@ -79,7 +79,7 @@ sys::cas_flag sys::AtomicDecrement(volatile sys::cas_flag* ptr) {
|
||||
}
|
||||
|
||||
sys::cas_flag sys::AtomicAdd(volatile sys::cas_flag* ptr, sys::cas_flag val) {
|
||||
#if LLVM_MULTITHREADED==0
|
||||
#if !defined(LLVM_MULTITHREADED)
|
||||
*ptr += val;
|
||||
return *ptr;
|
||||
#elif defined(__GNUC__)
|
||||
|
@ -564,7 +564,7 @@
|
||||
/* #undef LLVM_MANDIR */
|
||||
|
||||
/* Build multithreading support into LLVM */
|
||||
#define LLVM_MULTITHREADED 0
|
||||
/* #undef LLVM_MULTITHREADED */
|
||||
|
||||
/* LLVM architecture name for the native architecture, if available */
|
||||
#define LLVM_NATIVE_ARCH X86
|
||||
|
@ -49,7 +49,7 @@
|
||||
/* #undef LLVM_MANDIR */
|
||||
|
||||
/* Build multithreading support into LLVM */
|
||||
#define LLVM_MULTITHREADED 0
|
||||
/* #undef LLVM_MULTITHREADED */
|
||||
|
||||
/* LLVM architecture name for the native architecture, if available */
|
||||
#define LLVM_NATIVE_ARCH X86
|
||||
|
Loading…
Reference in New Issue
Block a user