[llvm] r348970 - Support: use internal `call_once` on PPC64le
Saleem Abdulrasool via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 12 12:35:47 PST 2018
Author: compnerd
Date: Wed Dec 12 12:35:47 2018
New Revision: 348970
URL: http://llvm.org/viewvc/llvm-project?rev=348970&view=rev
Log:
Support: use internal `call_once` on PPC64le
Use the replacement execute once threading support in LLVM for PPC64le. It
seems that GCC does not define `__ppc__` and so we would actually call out to
the C++ runtime there which is not what the current code intended. Check both
`__ppc__` and `__PPC__`. This avoids the need for checking the endianness.
Thanks to nemanjai for the hint about GCC's behaviour and the fact that the
reviewed condition could be simplified.
Original patch by Sarvesh Tamba!
Modified:
llvm/trunk/include/llvm/Support/Threading.h
Modified: llvm/trunk/include/llvm/Support/Threading.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Threading.h?rev=348970&r1=348969&r2=348970&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Threading.h (original)
+++ llvm/trunk/include/llvm/Support/Threading.h Wed Dec 12 12:35:47 2018
@@ -27,7 +27,8 @@
#define LLVM_THREADING_USE_STD_CALL_ONCE 1
#elif defined(LLVM_ON_UNIX) && \
(defined(_LIBCPP_VERSION) || \
- !(defined(__NetBSD__) || defined(__OpenBSD__) || defined(__ppc__)))
+ !(defined(__NetBSD__) || defined(__OpenBSD__) || \
+ (defined(__ppc__) || defined(__PPC__))))
// std::call_once from libc++ is used on all Unix platforms. Other
// implementations like libstdc++ are known to have problems on NetBSD,
// OpenBSD and PowerPC.
More information about the llvm-commits
mailing list