Fix -Werror build for runtime on android_arm32 and android_x86 (#3460)
This commit is contained in:
committed by
GitHub
parent
3f868cc55d
commit
064d95baa3
@@ -39,6 +39,15 @@ ALWAYS_INLINE inline bool compareAndSet(volatile T* where, T expectedValue, T ne
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
|
||||||
|
#if KONAN_ANDROID && (KONAN_ARM32 || KONAN_X86)
|
||||||
|
// On 32-bit Android clang generates library calls for "large" atomic operations
|
||||||
|
// and warns about "significant performance penalty". See more details here:
|
||||||
|
// https://github.com/llvm/llvm-project/blob/ce56e1a1cc5714f4af5675dd963cfebed766d9e1/clang/lib/CodeGen/CGAtomic.cpp#L775
|
||||||
|
// Ignore these warnings:
|
||||||
|
#pragma clang diagnostic ignored "-Watomic-alignment"
|
||||||
|
#endif
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
ALWAYS_INLINE inline void atomicSet(volatile T* where, T what) {
|
ALWAYS_INLINE inline void atomicSet(volatile T* where, T what) {
|
||||||
@@ -60,6 +69,8 @@ ALWAYS_INLINE inline T atomicGet(volatile T* where) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
static ALWAYS_INLINE inline void synchronize() {
|
static ALWAYS_INLINE inline void synchronize() {
|
||||||
#ifndef KONAN_NO_THREADS
|
#ifndef KONAN_NO_THREADS
|
||||||
__sync_synchronize();
|
__sync_synchronize();
|
||||||
|
|||||||
Reference in New Issue
Block a user